Skip to content

Commit 3b568f7

Browse files
committed
Actually fix PHP Package tests
Turns out we need the php-src test-runner....
1 parent de13e60 commit 3b568f7

File tree

6 files changed

+26
-55
lines changed

6 files changed

+26
-55
lines changed

tests/TestRender.php

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -9,16 +9,15 @@
99
class TestRender {
1010
protected $format;
1111

12-
public function __construct($formatclass, $opts, $extra = array()) {
12+
public function __construct($formatClass, $opts, $extra = array()) {
1313
foreach ($opts as $k => $v) {
1414
$method = "set_$k";
1515
Config::$method($v);
1616
}
1717
if (count($extra) != 0) {
1818
Config::init($extra);
1919
}
20-
$classname = __NAMESPACE__ . "\\" . $formatclass;
21-
$this->format = new $classname();
20+
$this->format = new $formatClass();
2221
}
2322

2423
public function run() {

tests/php/bug49101-1.phpt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ use phpdotnet\phd\Tests\TestRender;
88

99
require_once __DIR__ . "/../setup.php";
1010

11-
$formatclass = "TestChunkedXHTML";
11+
$formatclass = TestChunkedXHTML::class;
1212
$xml_file = __DIR__ . "/data/bug49101-1.xml";
1313

1414
$opts = array(

tests/php/bug49101-2.phpt

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,8 @@ use phpdotnet\phd\Tests\TestRender;
88

99
require_once __DIR__ . "/../setup.php";
1010

11-
$formatclass = "TestBigXHTML";
11+
/* Need partial namespaced Class therefore we cannot use ::class */
12+
$formatclass = TestBigXHTML::class;
1213
$xml_file = __DIR__ . "/data/bug49101-1.xml";
1314

1415
$opts = array(

tests/php/bug49102-1.phpt

Lines changed: 16 additions & 49 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ use phpdotnet\phd\Tests\TestRender;
88

99
require_once __DIR__ . "/../setup.php";
1010

11-
$formatclass = "TestChunkedXHTML";
11+
$formatclass = TestChunkedXHTML::class;
1212
$xml_file = __DIR__ . "/data/bug49102-1.xml";
1313

1414
$opts = array(
@@ -54,61 +54,28 @@ Content:
5454
<strong class="classname">SplDoublyLinkedList</strong>
5555
</span>
5656

57-
<span class="oointerface">implements
58-
<span class="interfacename"><strong class="interfacename">Iterator</strong></span>
59-
</span>
60-
61-
<span class="oointerface">,
62-
<span class="interfacename"><strong class="interfacename">ArrayAccess</strong></span>
63-
</span>
64-
65-
<span class="oointerface">,
66-
<span class="interfacename"><strong class="interfacename">Countable</strong></span>
67-
</span>
68-
{</div>
57+
<span class="oointerface"><span class="modifier">implements</span>
58+
<span class="interfacename"><strong class="interfacename">Iterator</strong></span></span><span class="oointerface">, <span class="interfacename"><strong class="interfacename">ArrayAccess</strong></span></span><span class="oointerface">, <span class="interfacename"><strong class="interfacename">Countable</strong></span></span> {</div>
6959

7060
<div class="classsynopsisinfo classsynopsisinfo_comment">/* Methods */</div>
7161
<div class="constructorsynopsis dc-description">
72-
<span class="methodname"><strong>__construct</strong></span>
73-
( <span class="methodparam">void</span>
74-
)</div>
62+
<span class="methodname"><strong>__construct</strong></span>()</div>
7563

76-
<div class="methodsynopsis dc-description">
77-
<span class="type">void</span> <span class="methodname"><strong>setIteratorMode</strong></span>
78-
( <span class="methodparam"><span class="type">int</span> <code class="parameter">$mode</code></span>
79-
)</div>
64+
<div class="methodsynopsis dc-description"><span class="methodname"><strong>setIteratorMode</strong></span>(<span class="methodparam"><span class="type">int</span> <code class="parameter">$mode</code></span>): <span class="type"><span class="type void">void</span></span></div>
8065

8166

8267
<div class="classsynopsisinfo classsynopsisinfo_comment">/* Inherited methods */</div>
83-
<div class="methodsynopsis dc-description">
84-
<span class="type">mixed</span> <span class="methodname"><strong>SplDoublyLinkedList::bottom</strong></span>
85-
( <span class="methodparam">void</span>
86-
)</div>
87-
88-
<div class="methodsynopsis dc-description">
89-
<span class="type">int</span> <span class="methodname"><strong>SplDoublyLinkedList::count</strong></span>
90-
( <span class="methodparam">void</span>
91-
)</div>
92-
93-
<div class="methodsynopsis dc-description">
94-
<span class="type">mixed</span> <span class="methodname"><strong>SplDoublyLinkedList::current</strong></span>
95-
( <span class="methodparam">void</span>
96-
)</div>
97-
98-
<div class="methodsynopsis dc-description">
99-
<span class="type">int</span> <span class="methodname"><strong>SplDoublyLinkedList::getIteratorMode</strong></span>
100-
( <span class="methodparam">void</span>
101-
)</div>
102-
103-
<div class="methodsynopsis dc-description">
104-
<span class="type">bool</span> <span class="methodname"><strong>SplDoublyLinkedList::offsetExists</strong></span>
105-
( <span class="methodparam"><span class="type"><a href="language.pseudo-types.html#language.types.mixed" class="type mixed">mixed</a></span> <code class="parameter">$index</code></span>
106-
)</div>
107-
108-
<div class="methodsynopsis dc-description">
109-
<span class="type">mixed</span> <span class="methodname"><strong>SplDoublyLinkedList::offsetGet</strong></span>
110-
( <span class="methodparam"><span class="type"><a href="language.pseudo-types.html#language.types.mixed" class="type mixed">mixed</a></span> <code class="parameter">$index</code></span>
111-
)</div>
68+
<div class="methodsynopsis dc-description"><span class="methodname"><strong>SplDoublyLinkedList::bottom</strong></span>(): <span class="type"><a href="language.types.declarations.html#language.types.declarations.mixed" class="type mixed">mixed</a></span></div>
69+
70+
<div class="methodsynopsis dc-description"><span class="methodname"><strong>SplDoublyLinkedList::count</strong></span>(): <span class="type">int</span></div>
71+
72+
<div class="methodsynopsis dc-description"><span class="methodname"><strong>SplDoublyLinkedList::current</strong></span>(): <span class="type"><a href="language.types.declarations.html#language.types.declarations.mixed" class="type mixed">mixed</a></span></div>
73+
74+
<div class="methodsynopsis dc-description"><span class="methodname"><strong>SplDoublyLinkedList::getIteratorMode</strong></span>(): <span class="type">int</span></div>
75+
76+
<div class="methodsynopsis dc-description"><span class="methodname"><strong>SplDoublyLinkedList::offsetExists</strong></span>(<span class="methodparam"><span class="type"><a href="language.types.declarations.html#language.types.declarations.mixed" class="type mixed">mixed</a></span> <code class="parameter">$index</code></span>): <span class="type">bool</span></div>
77+
78+
<div class="methodsynopsis dc-description"><span class="methodname"><strong>SplDoublyLinkedList::offsetGet</strong></span>(<span class="methodparam"><span class="type"><a href="language.types.declarations.html#language.types.declarations.mixed" class="type mixed">mixed</a></span> <code class="parameter">$index</code></span>): <span class="type"><a href="language.types.declarations.html#language.types.declarations.mixed" class="type mixed">mixed</a></span></div>
11279

11380
}</div>
11481

tests/php/faq001.phpt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ use phpdotnet\phd\Tests\TestRender;
88

99
require_once __DIR__ . "/../setup.php";
1010

11-
$formatclass = "TestChunkedXHTML";
11+
$formatclass = TestChunkedXHTML::class;
1212
$xml_file = __DIR__ . "/data/faq001.xml";
1313

1414
$opts = array(

tests/setup.php

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,13 @@
11
<?php
22
namespace phpdotnet\phd\Tests;
33

4+
use phpdotnet\phd\Config;
5+
46
require_once __DIR__ . '/../vendor/autoload.php';
57
require_once __DIR__ . "/../src/functions.php";
68

9+
Config::setMemoryIndex(true);
10+
711
/*
812
* vim600: sw=4 ts=4 syntax=php et
913
* vim<600: sw=4 ts=4

0 commit comments

Comments
 (0)