These results are based on our legacy PHP analysis, consider migrating to our new PHP analysis engine instead. Learn more
1 | <?php |
||
2 | |||
3 | /** |
||
4 | * @copyright Metaways Infosystems GmbH, 2013 |
||
5 | * @license LGPLv3, http://opensource.org/licenses/LGPL-3.0 |
||
6 | * @copyright Aimeos (aimeos.org), 2015-2017 |
||
7 | */ |
||
8 | |||
9 | |||
10 | namespace Aimeos\Controller\Jobs\Common\Decorator; |
||
11 | |||
12 | |||
13 | /** |
||
14 | * Test class for \Aimeos\Controller\Jobs\Common\Decorator\BaseTest. |
||
15 | */ |
||
16 | class BaseTest extends \PHPUnit\Framework\TestCase |
||
17 | { |
||
18 | private $stub; |
||
19 | private $object; |
||
20 | |||
21 | |||
22 | /** |
||
23 | * Sets up the fixture, for example, opens a network connection. |
||
24 | * This method is called before a test is executed. |
||
25 | * |
||
26 | * @access protected |
||
27 | */ |
||
28 | protected function setUp() |
||
29 | { |
||
30 | $context = \TestHelperJobs::getContext(); |
||
31 | $aimeos = \TestHelperJobs::getAimeos(); |
||
32 | |||
33 | $this->stub = $this->getMockBuilder( '\\Aimeos\\Controller\\Jobs\\Iface' ) |
||
34 | ->setConstructorArgs( array( $context, $aimeos ) ) |
||
35 | ->getMock(); |
||
36 | |||
37 | $this->object = new TestBase( $this->stub, $context, $aimeos ); |
||
38 | } |
||
39 | |||
40 | |||
41 | protected function tearDown() |
||
42 | { |
||
43 | unset( $this->object ); |
||
44 | } |
||
45 | |||
46 | |||
47 | public function testGetContext() |
||
48 | { |
||
49 | $this->assertInstanceOf( '\\Aimeos\\MShop\\Context\\Item\\Iface', $this->object->getContextPublic() ); |
||
50 | } |
||
51 | |||
52 | |||
53 | public function testGetAimeos() |
||
54 | { |
||
55 | $this->assertInstanceOf( '\Aimeos\Bootstrap', $this->object->getAimeosPublic() ); |
||
56 | } |
||
57 | |||
58 | |||
59 | public function testCall() |
||
60 | { |
||
61 | $this->markTestInComplete( 'PHP warning is triggered instead of exception' ); |
||
62 | } |
||
63 | |||
64 | } |
||
65 | |||
66 | |||
67 | class TestBase |
||
0 ignored issues
–
show
|
|||
68 | extends \Aimeos\Controller\Jobs\Common\Decorator\Base |
||
69 | { |
||
70 | public function getContextPublic() |
||
71 | { |
||
72 | return $this->getContext(); |
||
73 | } |
||
74 | |||
75 | public function getAimeosPublic() |
||
76 | { |
||
77 | return $this->getAimeos(); |
||
78 | } |
||
79 | } |
||
80 |
Having each class in a dedicated file usually plays nice with PSR autoloaders and is therefore a well established practice. If you use other autoloaders, you might not want to follow this rule.