Advertisement
Guest User

Untitled

a guest
Feb 5th, 2016
72
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.60 KB | None | 0 0
  1. <?php
  2.  
  3. class WeatherBuilderTest extends PHPUnit_Framework_TestCase
  4. {
  5. private $prophet;
  6.  
  7. protected function setUp()
  8. {
  9. $this->prophet = new \Prophecy\Prophet;
  10. }
  11.  
  12. public function itReturnsASunnyObjectWhenTheWeatherIsSunny()
  13. {
  14. $externalWeatherAPI = $this->prophet->prophesize('ExternalWeatherAPIObject');
  15. $weatherBuilder = new WeatherBuilder($externalWeatherAPI->reveal());
  16. $externalWeatherAPI->getWeather()->willReturn('SUNNY');
  17. $weatherObject = $weather->buildWeatherObject();
  18. $this->assertInstanceOf('SunnyObject', $weatherObject);
  19. }
  20. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement