I've just started learning to work with Behat in Laravel 5 and wonder how I could verify email sending. I tried this tutorial but it did not work (maybe it's out of date?). I also tried googling but couldn't find many sources. If you could show me how to achieve this, or direct me to a nice tutorial, I'd be really grateful.
Thanks!
I personally use mailtrap instead of mocking. I find it very usefull.
If you have set all the requirements, you can fetch your last sent mail by this method:
$lastEmail = $this->fetchInbox()[0];
Then you can retrieve let's say the title like this:
$subject = $lastEmail['subject'];
For a nice and clean tutorial watch: https://laracasts.com/lessons/trapping-your-email
I hope it helps!
Related
Please direct me the right way. I'm stuck with some documentation issue. Going to code a small service with Google HOME for everyone to add a new phrase and make a POST request or answer with specific "TEXT" (like IFTTT run with WEBHOOKS) (fe: "Hey Google switch my kitchen light" -> service will send POST request to my own HTTP server). I know that IFTTT works but - I would to code the target service for tiny cases with fast response.
I tried to understand all Google Assistant layers - but still no luck and didn't find the clear path.
What I learned are:
1. connect to Google Account using OAuth 2
2. .... save the phrase and action for that in my DB - it's ok and simple way
3. ...??? how to send and to where? in (json?) a specific format
4. receive the answer from google home to understand the right case and make my action.... (for example: turn on\off the kitchen light)
It should be not so hard as I can image.... anyway Please help :).
Appreciate your time and answers and have a nice day!
To learn about extending the Google Assistant, you should look into the documentation for Actions on Google: https://developers.google.com/actions/extending-the-assistant
Although it also seems like you want to use it for Smart Home: https://developers.google.com/actions/smarthome/
You can run the Smart Home sample if you want to see how it works: https://github.com/actions-on-google/actionssdk-smart-home-nodejs
I try to call my own api with laravel I tried all the options like:
in the answers:
Consuming my own Laravel API
or in this blog:
http://blog.antoine-augusti.fr/2014/04/laravel-calling-your-api/
and this plugin:
https://github.com/teepluss/laravel4-hmvc
sorry for sound dumb I dont understand all the things but they not make full 100% real request like
for example with normal ajax post request i can do this to get some parameter:
Request::createFromGlobals()->request->get('some-parameter')
but with the others techniqe this just return null
I am using this way becase thats the way how "thephpleague/oauth2-server" plugin get the post parametrs
( https://github.com/thephpleague/oauth2-server/blob/master/src/AuthorizationServer.php#L234 )
so my question: is there a real way to call other route and to make it 100% look like normal request?
From what it sounds like you are trying to do you could use Snoopy or cURL to make actual calls.
The real question is why do these need to be actual calls? The first link you posted has some really great examples that would work well for any calls that go directly back to your Laravel application. That article linked to a module called HMVC which keeps your code looking neat and simplifies the process.
Any HTTP Client will do this.
Guzzle
Buzz
Requests
I want to perform load testing using jmeter tool on the below url, How can i achieve this,
http://thebus.in/B2C/Result.aspx?sourceId=1128&destinationId=198&doj=15/October/2014&dor=30/October/2014
How can i achieve this?
Glad to know that you chose Jmeter, which i love, for your load testing requirements.
Please refer to the tutorials below to get some basic idea.
http://www.youtube.com/watch?v=4mfFSrxpl0Y
http://www.tutorialspoint.com/jmeter/jmeter_build_test_plan.htm
& Ofcourse,
http://jmeter.apache.org/usermanual/
When you come up with your own script and if it does not work as expected, Then ask your questions here to get them clarified!!
I am trying to create a simple reply from my twitter timeline but ran into some problems and as a ruby newbie I had problems in understanding the doc.
Twitter.mentions_timeline.each do |tweet|
reply_to = tweet.from_user_name()
#Twitter.update("##{reply_to} Not today.")
end
This is what've written so far, which is not much. Unfortunately the tweet doesn't have any from_user_name when using the mentions_timeline it seems. I am using this gem and does not find any good examples of this: https://github.com/sferik/twitter
Would be very nice to have some nice example of how to grab ones tweets from the timeline and replying to those. Also does twitter have anything that distinguish "new tweets" or do I need to create some kind of storage myself to seperate new from old?
Thanks in advance :)
EDIT: to clarify, I want to get all tweets sent to me directly and reply to them. I don't really want to continue in any conversation.
A little late, but in the lastest version of twitter gem you can reply to a tweet with:
#client.update("##{reply_to.user.username} Not today.", in_reply_to_status_id: reply_to.id)
Hope this helps someone.
Here are a few examples that might be helpful for anyone using sferik's twitter gem for something like this. Note, I'm using version 5.0.0 currently, so your mileage may vary.
Assuming you've configured the REST client and assigned it to a variable named client, you can get an array of your last 20 mentions (or however many you've received in the past 2 months, if fewer) with this line:
client.mentions_timeline.map(&:full_text)
The respective mentioners of those tweets can be acquired similarly with this:
client.mentions_timeline.map(&:user).map(&:username)
You could then use client.update as suggested to reply as you see fit.
One tool I find incredibly useful when I'm exploring API's in Ruby is pry. Just require it, drop a binding.pry, and run your code in Terminal. Then you can explore to your heart's — or API's limit's — extent.
could any one guide me on how can I update status on linkedin using codeigniter?
Any help appreciated thanks!
I implemented this library into CI to make sure a user could log in with his LinkedIn profile. Maybe you can also update the status of a user.
http://code.google.com/p/simple-linkedinphp/
Implementing it in CI is pretty easy if you know your way around in CI.
I really like it when people write libraries for others to use and the code is commented/well thought out/well structured and is easy to follow.
I tried the other examples, but settled on this one.
http://blog.justni.com/posting-to-linkedin-from-php-and-codeigniter/
Edit:
Having banged my head for a long time on the POS code of Sudhir and the code above. Yes I can change my opinion, because when I started to work on it, it just doesn't work!.
Although I am new to CI, I managed to do the same as P.T and implemented the lib into CI.
The simple-linkedinphp class works like a charm.
I can now authorise an app, authenticate, get profile details and even post to linkedin.
I even posted a comment on Sundir's blog that it doesn't work and he deleted the comment! Stay away, well away if you don't want any headaches!