GitHub Access Token became invalid

It seems like the GitHub access token used for retrieving details about this repository from GitHub became invalid. This might prevent certain types of inspections from being run (in particular, everything related to pull requests).
Please ask an admin of your repository to re-new the access token on this website.
Completed
Push — master ( 8a3870...4a329e )
by Lukáš
05:12 queued 01:06
created

ProxyExtensionTest::testExtension()   B

Complexity

Conditions 5
Paths 4

Size

Total Lines 29
Code Lines 18

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
dl 0
loc 29
rs 8.439
c 0
b 0
f 0
cc 5
eloc 18
nc 4
nop 0
1
<?php
2
declare(strict_types=1);
3
4
namespace Lookyman\Nette\Proxy\Tests;
5
6
use Lookyman\Nette\Proxy\Tests\Mock\IService2Factory;
7
use Lookyman\Nette\Proxy\Tests\Mock\Service1;
8
use Lookyman\Nette\Proxy\Tests\Mock\Service2;
9
use Nette\Configurator;
10
use ProxyManager\Proxy\ProxyInterface;
11
12
class ProxyExtensionTest extends \PHPUnit_Framework_TestCase
13
{
14
	public function testExtension()
15
	{
16
		$tempDir = __DIR__ . '/../temp';
17
		if (!@mkdir($tempDir, 0777, true) && !is_dir($tempDir)) {
18
			throw new \RuntimeException(sprintf('Cannot create temp directory %s', $tempDir));
19
		}
20
21
		/** @var \SplFileInfo $entry */
22
		foreach (new \RecursiveIteratorIterator(new \RecursiveDirectoryIterator($tempDir, \RecursiveDirectoryIterator::SKIP_DOTS), \RecursiveIteratorIterator::CHILD_FIRST) as $entry) {
23
			$entry->isDir() ? rmdir((string) $entry) : unlink((string) $entry);
24
		}
25
26
		$container = (new Configurator())
27
			->setTempDirectory($tempDir)
28
			->setDebugMode(true)
29
			->addConfig(__DIR__ . '/config.neon')
30
			->createContainer();
31
		$container->initialize();
32
33
		/** @var Service1 $service1 */
34
		$service1 = $container->getByType(Service1::class);
35
		self::assertInstanceOf(ProxyInterface::class, $service1);
36
		self::assertEquals('bar', $service1->foo());
37
38
		/** @var IService2Factory $service2Factory */
39
		$service2Factory = $container->getByType(IService2Factory::class);
40
		self::assertInstanceOf(ProxyInterface::class, $service2Factory);
41
		self::assertInstanceOf(Service2::class, $service2Factory->create());
42
	}
43
}
44