Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- class WeatherBuilderTest extends PHPUnit_Framework_TestCase
- {
- private $prophet;
- protected function setUp()
- {
- $this->prophet = new \Prophecy\Prophet;
- }
- public function itReturnsASunnyObjectWhenTheWeatherIsSunny()
- {
- $externalWeatherAPI = $this->prophet->prophesize('ExternalWeatherAPIObject');
- $weatherBuilder = new WeatherBuilder($externalWeatherAPI->reveal());
- $externalWeatherAPI->getWeather()->willReturn('SUNNY');
- $weatherObject = $weather->buildWeatherObject();
- $this->assertInstanceOf('SunnyObject', $weatherObject);
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement