1
|
|
|
<?php |
2
|
|
|
|
3
|
|
|
/** |
4
|
|
|
* This file is part of the Cubiche package. |
5
|
|
|
* |
6
|
|
|
* Copyright (c) Cubiche |
7
|
|
|
* |
8
|
|
|
* For the full copyright and license information, please view the LICENSE |
9
|
|
|
* file that was distributed with this source code. |
10
|
|
|
*/ |
11
|
|
|
namespace Cubiche\Core\Collections\Tests\Units; |
12
|
|
|
|
13
|
|
|
use Cubiche\Core\Collections\Tests\Asserters\CollectionAsserter; |
14
|
|
|
use Cubiche\Core\Collections\Tests\Asserters\HashMapAsserter; |
15
|
|
|
use Cubiche\Core\Collections\Tests\Asserters\ListAsserter; |
16
|
|
|
use Cubiche\Core\Collections\Tests\Asserters\SetAsserter; |
17
|
|
|
use Cubiche\Core\Collections\Tests\Asserters\Asserters; |
18
|
|
|
use Cubiche\Tests\TestCase as BaseTestCase; |
19
|
|
|
use mageekguy\atoum\adapter as Adapter; |
20
|
|
|
use mageekguy\atoum\annotations\extractor as Extractor; |
21
|
|
|
use mageekguy\atoum\asserter\generator as Generator; |
22
|
|
|
use mageekguy\atoum\test\assertion\manager as Manager; |
23
|
|
|
use mageekguy\atoum\tools\variable\analyzer as Analyzer; |
24
|
|
|
|
25
|
|
|
/** |
26
|
|
|
* Abstract Test Case class. |
27
|
|
|
* |
28
|
|
|
* @method CollectionAsserter collection() |
29
|
|
|
* @method ListAsserter list() |
30
|
|
|
* @method SetAsserter set() |
31
|
|
|
* @method HashMapAsserter hashmap() |
32
|
|
|
* |
33
|
|
|
* @author Ivannis Suárez Jerez <[email protected]> |
34
|
|
|
* @author Karel Osorio Ramírez <[email protected]> |
35
|
|
|
*/ |
36
|
|
|
abstract class TestCase extends BaseTestCase |
37
|
|
|
{ |
38
|
|
|
use Asserters; |
39
|
|
|
|
40
|
|
|
/** |
41
|
|
|
* @param Adapter $adapter |
42
|
|
|
* @param Extractor $annotationExtractor |
43
|
|
|
* @param Generator $asserterGenerator |
44
|
|
|
* @param Manager $assertionManager |
45
|
|
|
* @param \Closure $reflectionClassFactory |
46
|
|
|
* @param \Closure $phpExtensionFactory |
47
|
|
|
* @param Analyzer $analyzer |
48
|
|
|
*/ |
49
|
|
|
public function __construct( |
50
|
|
|
Adapter $adapter = null, |
51
|
|
|
Extractor $annotationExtractor = null, |
52
|
|
|
Generator $asserterGenerator = null, |
53
|
|
|
Manager $assertionManager = null, |
54
|
|
|
\Closure $reflectionClassFactory = null, |
55
|
|
|
\Closure $phpExtensionFactory = null, |
56
|
|
|
Analyzer $analyzer = null |
57
|
|
|
) { |
58
|
|
|
parent::__construct( |
59
|
|
|
$adapter, |
60
|
|
|
$annotationExtractor, |
61
|
|
|
$asserterGenerator, |
62
|
|
|
$assertionManager, |
63
|
|
|
$reflectionClassFactory, |
64
|
|
|
$phpExtensionFactory, |
65
|
|
|
$analyzer |
66
|
|
|
); |
67
|
|
|
|
68
|
|
|
$this->getAsserterGenerator()->addNamespace('Cubiche\Core\Equatable\Tests\Asserters'); |
69
|
|
|
$this->getAsserterGenerator()->addNamespace('Cubiche\Core\Collections\Tests\Asserters'); |
70
|
|
|
|
71
|
|
|
$this->getAssertionManager()->setAlias('variable', 'VariableAsserter'); |
72
|
|
|
$this->getAssertionManager()->setAlias('collection', 'CollectionAsserter'); |
73
|
|
|
$this->getAssertionManager()->setAlias('list', 'ListAsserter'); |
74
|
|
|
$this->getAssertionManager()->setAlias('set', 'SetAsserter'); |
75
|
|
|
$this->getAssertionManager()->setAlias('hashmap', 'HashMapAsserter'); |
76
|
|
|
$this->getAssertionManager()->setAlias('datasource', 'DataSourceAsserter'); |
77
|
|
|
} |
78
|
|
|
} |
79
|
|
|
|