These results are based on our legacy PHP analysis, consider migrating to our new PHP analysis engine instead. Learn more
1 | <?php |
||
2 | namespace Redaxscript\Tests\Admin\View; |
||
3 | |||
4 | use Redaxscript\Admin; |
||
5 | use Redaxscript\Db; |
||
6 | use Redaxscript\Tests\TestCaseAbstract; |
||
7 | |||
8 | /** |
||
9 | * ArticleFormTest |
||
10 | * |
||
11 | * @since 3.0.0 |
||
12 | * |
||
13 | * @package Redaxscript |
||
14 | * @category Tests |
||
15 | * @author Henry Ruhs |
||
16 | * |
||
17 | * @covers Redaxscript\Admin\View\ArticleForm |
||
18 | * @covers Redaxscript\Admin\View\ViewAbstract |
||
19 | */ |
||
20 | |||
21 | class ArticleFormTest extends TestCaseAbstract |
||
22 | { |
||
23 | /** |
||
24 | * setUp |
||
25 | * |
||
26 | * @since 3.1.0 |
||
27 | */ |
||
28 | |||
29 | public function setUp() : void |
||
30 | { |
||
31 | parent::setUp(); |
||
32 | $installer = $this->installerFactory(); |
||
0 ignored issues
–
show
|
|||
33 | $installer->init(); |
||
34 | $installer->rawCreate(); |
||
35 | Db::forTablePrefix('articles') |
||
36 | ->create() |
||
37 | ->set( |
||
38 | [ |
||
39 | 'title' => 'Article One', |
||
40 | 'alias' => 'article-one' |
||
41 | ]) |
||
42 | ->save(); |
||
43 | } |
||
44 | |||
45 | /** |
||
46 | * tearDown |
||
47 | * |
||
48 | * @since 3.1.0 |
||
49 | */ |
||
50 | |||
51 | public function tearDown() : void |
||
52 | { |
||
53 | $this->dropDatabase(); |
||
0 ignored issues
–
show
The method
dropDatabase() does not seem to exist on object<Redaxscript\Tests...n\View\ArticleFormTest> .
This check looks for calls to methods that do not seem to exist on a given type. It looks for the method on the type itself as well as in inherited classes or implemented interfaces. This is most likely a typographical error or the method has been renamed.
Loading history...
|
|||
54 | } |
||
55 | |||
56 | /** |
||
57 | * testRender |
||
58 | * |
||
59 | * @since 3.0.0 |
||
60 | * |
||
61 | * @param array $registryArray |
||
62 | * @param int $articleId |
||
63 | * @param array $expectArray |
||
64 | * |
||
65 | * @dataProvider providerAutoloader |
||
66 | */ |
||
67 | |||
68 | public function testRender(array $registryArray = [], int $articleId = null, array $expectArray = []) : void |
||
69 | { |
||
70 | /* setup */ |
||
71 | |||
72 | $this->_registry->init($registryArray); |
||
73 | $articleForm = new Admin\View\ArticleForm($this->_registry, $this->_language); |
||
74 | |||
75 | /* actual */ |
||
76 | |||
77 | $actual = $articleForm->render($articleId); |
||
78 | |||
79 | /* compare */ |
||
80 | |||
81 | $this->assertStringStartsWith($expectArray['start'], $actual); |
||
82 | $this->assertStringEndsWith($expectArray['end'], $actual); |
||
83 | } |
||
84 | } |
||
85 |
This check looks for calls to methods that do not seem to exist on a given type. It looks for the method on the type itself as well as in inherited classes or implemented interfaces.
This is most likely a typographical error or the method has been renamed.