| Conditions | 1 |
| Paths | 1 |
| Total Lines | 16 |
| Code Lines | 13 |
| Lines | 0 |
| Ratio | 0 % |
| Changes | 0 | ||
| 1 | <?php |
||
| 32 | public function testIsUrlValid() |
||
| 33 | { |
||
| 34 | $serviceRepository = Mockery::mock(ServiceRepository::class) |
||
| 35 | ->makePartial() |
||
| 36 | ->shouldReceive('getServiceByUrl') |
||
| 37 | ->andReturn(null) |
||
| 38 | ->getMock(); |
||
| 39 | $this->assertFalse($serviceRepository->isUrlValid('http://www.baidu.com')); |
||
| 40 | |||
| 41 | $serviceRepository = Mockery::mock(ServiceRepository::class) |
||
| 42 | ->makePartial() |
||
| 43 | ->shouldReceive('getServiceByUrl') |
||
| 44 | ->andReturn((object) ['enabled' => true]) |
||
| 45 | ->getMock(); |
||
| 46 | $this->assertTrue($serviceRepository->isUrlValid('http://www.baidu.com')); |
||
| 47 | } |
||
| 48 | } |
||
| 49 |