1 | <?php |
||
9 | class AutomatedLinkTest extends SapphireTest { |
||
10 | |||
11 | public static $fixture_file = 'fixtures/AutomatedLinkTest.yml'; |
||
12 | |||
13 | /** |
||
14 | * Test that links are included in the content field |
||
15 | */ |
||
16 | public function testInsertion(){ |
||
22 | |||
23 | /** |
||
24 | * Test the individual properties of the automated link |
||
25 | */ |
||
26 | public function testProperties(){ |
||
38 | |||
39 | /** |
||
40 | * Test that the default properties match what we expect |
||
41 | */ |
||
42 | public function testDefaultProperties(){ |
||
56 | |||
57 | /** |
||
58 | * Test that the default properties match what we expect |
||
59 | */ |
||
60 | public function testLimitFilter(){ |
||
66 | |||
67 | /** |
||
68 | * Test that the default properties match what we expect |
||
69 | */ |
||
70 | public function testDisableFilter(){ |
||
77 | |||
78 | /** |
||
79 | * Renders the passed $page and returns all links found if any |
||
80 | * |
||
81 | * @param SiteTree $page |
||
82 | * @return DOMNameList |
||
83 | */ |
||
84 | public static function getLinksFromPage(SiteTree $page){ |
||
88 | |||
89 | /** |
||
90 | * Create a DOMDocument out of the $page supplied and |
||
91 | * check that it only has 1 link. |
||
92 | * If it does return it, else fail the test |
||
93 | * |
||
94 | * @param SiteTree $page |
||
95 | * @return DOMDocument |
||
96 | */ |
||
97 | public static function getLinkFromPage(SiteTree $page){ |
||
101 | |||
102 | /** |
||
103 | * Create a dummy object for testing functionality on the SiteTree |
||
104 | * |
||
105 | * @param string|null $content |
||
106 | * @return Page |
||
107 | */ |
||
108 | public static function createPage($content=null){ |
||
113 | |||
114 | /** |
||
115 | * Render the $page supplied into a DOMDocument object |
||
116 | * |
||
117 | * @param Page $page |
||
118 | * @return DOMDocument |
||
119 | */ |
||
120 | public static function getPageDOM(Page $page){ |
||
125 | } |
||
126 | |||
128 |
It seems like the type of the argument is not accepted by the function/method which you are calling.
In some cases, in particular if PHP’s automatic type-juggling kicks in this might be fine. In other cases, however this might be a bug.
We suggest to add an explicit type cast like in the following example: