Conditions | 1 |
Paths | 1 |
Total Lines | 14 |
Code Lines | 9 |
Lines | 0 |
Ratio | 0 % |
Changes | 1 | ||
Bugs | 0 | Features | 0 |
1 | <?php |
||
18 | public function test_detectFromSubdomain() |
||
19 | { |
||
20 | $this->prepareConfig(); |
||
21 | $manager = new SectionsManager(); |
||
22 | $sections = $manager->getSections(); |
||
23 | |||
24 | /** @var Mockery\Mock|SectionDetector $detector */ |
||
25 | $detector = Mockery::mock(SectionDetector::class)->makePartial()->shouldAllowMockingProtectedMethods(); |
||
26 | $detector->shouldReceive('detectFromConstant')->andReturn(false); |
||
27 | $detector->shouldReceive('getCurrentSubdomain')->andReturn('sec2'); |
||
28 | |||
29 | $detected = $detector->detect($sections); |
||
30 | self::assertSame(1, $detected); |
||
31 | self::assertSame('sec2', $sections[$detected]->getSubdomain()); |
||
32 | } |
||
44 |