Skip to content

Commit 8f175be

Browse files
author
haszi
committed
Add test
1 parent 3910427 commit 8f175be

2 files changed

Lines changed: 28 additions & 0 deletions

File tree

tests/GH-225.phpt

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
--TEST--
2+
GH-225 - SaveConfig tries to overwrite readonly property
3+
--ARGS--
4+
--docbook tests/data/bug-GH-225.xml --quit
5+
--FILE--
6+
<?php
7+
namespace phpdotnet\phd;
8+
9+
if (\file_exists(__DIR__ . "/../phd.config.php")) {
10+
\unlink(__DIR__ . "/../phd.config.php");
11+
}
12+
13+
\file_put_contents(__DIR__ . "/../phd.config.php",
14+
"<?php
15+
return array (
16+
'copyright' => 'Should not be imported',
17+
);");
18+
19+
require_once __DIR__ . "/../render.php";
20+
?>
21+
--CLEAN--
22+
<?php
23+
\unlink(__DIR__ . "/../phd.config.php");
24+
?>
25+
--EXPECTF--
26+
%s[%d:%d:%d - Heads up ]%s Loaded config from existing file

tests/data/bug-GH-225.xml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
<test>
2+
</test>

0 commit comments

Comments
 (0)