-
-
Notifications
You must be signed in to change notification settings - Fork 0
/
AgnosticResolverTestCase.php
95 lines (82 loc) · 2.54 KB
/
AgnosticResolverTestCase.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
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
<?php
/*
* This file is part of the Allay package.
*
* (c) Cedric van Putten <me@bycedric.com>
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/
namespace ByCedric\Allay\Tests\Resource\Resolvers;
use ByCedric\Allay\Tests\Stubs\Resource\Resolvers\AgnosticResolver;
class AgnosticResolverTestCase extends \ByCedric\Allay\Tests\TestCase
{
/**
* Get a working instance of the agnostic resolver.
*
* @return \ByCedric\Allay\Resource\Resolvers\AgnosticResolver
*/
protected function getInstance()
{
return new AgnosticResolver();
}
public function testGetResourceParameterReturnsString()
{
$this->assertString(
$this->getInstance()->getResourceParameter(),
'Resolver did not return a valid resource parameter.'
);
}
public function testGetResourceUsesParameterToFetchAndReturnRouteValue()
{
$this->assertSame(
'resource',
$this->getInstance()->getResource(),
'Resolver did not return resource value correctly.'
);
}
public function testGetIdParameterReturnsString()
{
$this->assertString(
$this->getInstance()->getIdParameter(),
'Resolver did not return a valid id parameter.'
);
}
public function testGetIdUsesParameterToFetchAndReturnRouteValue()
{
$this->assertSame(
'id',
$this->getInstance()->getId(),
'Resolver did not return id value correctly.'
);
}
public function testGetRelationParameterReturnsString()
{
$this->assertString(
$this->getInstance()->getRelationParameter(),
'Resolver did not return a valid relation parameter.'
);
}
public function testGetRelationUsesParameterToFetchAndReturnRouteValue()
{
$this->assertSame(
'relation',
$this->getInstance()->getRelation(),
'Resolver did not return relation value correctly.'
);
}
public function testGetSubIdParameterReturnsString()
{
$this->assertString(
$this->getInstance()->getSubIdParameter(),
'Resolver did not return a valid sub-id parameter.'
);
}
public function testGetSubIdUsesParameterToFetchAndReturnRouteValue()
{
$this->assertSame('subid',
$this->getInstance()->getSubId(),
'Resolver did not return sub-id value correctly.'
);
}
}