logger = $this->createMock(LoggerInterface::class); } /** * @param string $theme * @return \PHPUnit\Framework\MockObject\MockObject */ public function getResourceLocator($theme) { $systemConfig = $this->createMock(SystemConfig::class); $systemConfig ->expects($this->any()) ->method('getValue') ->with('theme', '') ->willReturn($theme); $this->overwriteService(SystemConfig::class, $systemConfig); return $this->getMockForAbstractClass('OC\Template\ResourceLocator', [$this->logger], '', true, true, true, []); } public function testFind(): void { $locator = $this->getResourceLocator('theme'); $locator->expects($this->once()) ->method('doFind') ->with('foo'); $locator->expects($this->once()) ->method('doFindTheme') ->with('foo'); /** @var \OC\Template\ResourceLocator $locator */ $locator->find(['foo']); } public function testFindNotFound(): void { $systemConfig = $this->createMock(SystemConfig::class); $systemConfig->method('getValue') ->with('theme', '') ->willReturn('theme'); $this->overwriteService(SystemConfig::class, $systemConfig); $locator = $this->getResourceLocator('theme', ['core' => 'map'], ['3rd' => 'party'], ['foo' => 'bar']); $locator->expects($this->once()) ->method('doFind') ->with('foo') ->will($this->throwException(new ResourceNotFoundException('foo', 'map'))); $locator->expects($this->once()) ->method('doFindTheme') ->with('foo') ->will($this->throwException(new ResourceNotFoundException('foo', 'map'))); $this->logger->expects($this->exactly(2)) ->method('debug') ->with($this->stringContains('map/foo')); /** @var \OC\Template\ResourceLocator $locator */ $locator->find(['foo']); } public function testAppendIfExist(): void { $locator = $this->getResourceLocator('theme'); /** @var \OC\Template\ResourceLocator $locator */ $method = new \ReflectionMethod($locator, 'appendIfExist'); $method->setAccessible(true); $method->invoke($locator, __DIR__, basename(__FILE__), 'webroot'); $resource1 = [__DIR__, 'webroot', basename(__FILE__)]; $this->assertEquals([$resource1], $locator->getResources()); $method->invoke($locator, __DIR__, 'does-not-exist'); $this->assertEquals([$resource1], $locator->getResources()); } } mmitdiffstats
path: root/vendor/golang.org/x/net/ipv6/zsys_linux_mipsle.go
blob: ad71871b78a9bfc2316268ee2bb6262a2d9e9272 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72