-
-
Notifications
You must be signed in to change notification settings - Fork 8
/
Copy pathRouteNotFoundTest.php
49 lines (46 loc) · 1.47 KB
/
RouteNotFoundTest.php
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
<?php declare(strict_types=1);
/*
* This file is part of Aplus Framework Routing Library.
*
* (c) Natan Felles <natanfelles@gmail.com>
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/
namespace Tests\Routing\Attributes;
use Framework\Routing\Reflector;
use PHPUnit\Framework\TestCase;
use Tests\Routing\Support\UsersRouteActionsPresenter;
use Tests\Routing\Support\UsersRouteActionsResource;
final class RouteNotFoundTest extends TestCase
{
public function testWithOrigins() : void
{
$class = UsersRouteActionsResource::class;
$reflector = new Reflector($class);
$routes = $reflector->getRoutesNotFound();
self::assertContains([
'origins' => [
'http://api.domain.xyz',
'http://domain.com',
],
'action' => $class . '::notFoundWithOriginAttributes',
], $routes);
self::assertContains([
'origins' => [
'http://foo.net',
],
'action' => $class . '::notFoundWithOriginParam',
], $routes);
}
public function testWithoutOrigins() : void
{
$class = UsersRouteActionsPresenter::class;
$reflector = new Reflector($class);
$routes = $reflector->getRoutesNotFound();
self::assertContains([
'origins' => [],
'action' => $class . '::notFound',
], $routes);
}
}