|
@@ 91-100 (lines=10) @@
|
| 88 |
|
* @depends testConstruct |
| 89 |
|
* @dataProvider matchProvider |
| 90 |
|
*/ |
| 91 |
|
public function testMatch(SimplifiedRequest $request, $siteAccess, Router $router) |
| 92 |
|
{ |
| 93 |
|
$sa = $router->match($request); |
| 94 |
|
$this->assertInstanceOf('eZ\\Publish\\Core\\MVC\\Symfony\\SiteAccess', $sa); |
| 95 |
|
$this->assertSame($siteAccess, $sa->name); |
| 96 |
|
// SiteAccess must be serializable as a whole |
| 97 |
|
// See https://jira.ez.no/browse/EZP-21613 |
| 98 |
|
$this->assertInternalType('string', serialize($sa)); |
| 99 |
|
$router->setSiteAccess(); |
| 100 |
|
} |
| 101 |
|
|
| 102 |
|
/** |
| 103 |
|
* @depends testConstructDebug |
|
@@ 129-138 (lines=10) @@
|
| 126 |
|
/** |
| 127 |
|
* @depends testConstruct |
| 128 |
|
*/ |
| 129 |
|
public function testMatchWithEnv(Router $router) |
| 130 |
|
{ |
| 131 |
|
$saName = 'first_sa'; |
| 132 |
|
putenv("EZPUBLISH_SITEACCESS=$saName"); |
| 133 |
|
$sa = $router->match(new SimplifiedRequest()); |
| 134 |
|
$this->assertInstanceOf('eZ\\Publish\\Core\\MVC\\Symfony\\SiteAccess', $sa); |
| 135 |
|
$this->assertSame($saName, $sa->name); |
| 136 |
|
$this->assertSame('env', $sa->matchingType); |
| 137 |
|
$router->setSiteAccess(); |
| 138 |
|
} |
| 139 |
|
|
| 140 |
|
/** |
| 141 |
|
* @param \eZ\Publish\Core\MVC\Symfony\SiteAccess\Router $router |