Skip to content

Commit 54b83e8

Browse files
committed
Allow freeform xsl transform on constructor
1 parent 4d82cee commit 54b83e8

File tree

3 files changed

+10
-14
lines changed

3 files changed

+10
-14
lines changed

src/class-xml-file.php

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -63,10 +63,13 @@ function __construct()
6363
if (strstr(strtolower($a[1]), "stacktrace")) $this->stacktrace = true;
6464
}
6565
if ($n >= 3) {
66-
if (is_string($a[2])) {
67-
if (substr($a[2], 0, 1) == "<") $this->transformXSL($a[2]);
68-
else if (file_exists($a[2])) $this->transform($a[2]);
69-
}
66+
$this->transform(self::toDoc($a[2]));
67+
// if (is_string($a[2])) {
68+
// if (substr($a[2], 0, 1) == "<") $this->transformXSL($a[2]);
69+
// else if (file_exists($a[2])) $this->transform($a[2]);
70+
// } else if (is_a($a[2], get_class())) {
71+
// $this->transform(self::toDoc($a[2]));
72+
// }
7073
}
7174
}
7275

test

Lines changed: 2 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -3,15 +3,8 @@ set -e
33

44
cd $(dirname $0)
55

6-
testFile() {
7-
php ../phpunit-6.5.14.phar --bootstrap src/stub.php $1
8-
}
9-
106
if [[ "$1" == "" ]]; then
11-
for f in tests/*test.php; do
12-
echo "test: $f"
13-
testFile $f
14-
done
7+
../phpunit $1 --bootstrap ./src/stub.php --test-suffix '_test.php,-test.php,Test.php,.phpt' tests
158
else
16-
testFile $1
9+
../phpunit --bootstrap ./src/stub.php $1
1710
fi

tests/properties-test.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ class properties_test extends TestCase
1515
const tagItem = 'set';
1616

1717
public function testSetGetListHas() {
18-
$propName = "1";
18+
$propName = "aa";
1919
$propValue = "2";
2020

2121
$obj = new xml_file();

0 commit comments

Comments
 (0)