Skip to content

Commit 2f6f7b6

Browse files
committed
Add test for writing to result
1 parent e466467 commit 2f6f7b6

File tree

1 file changed

+9
-1
lines changed

1 file changed

+9
-1
lines changed

src/test/php/lang/ast/unittest/ResultTest.class.php

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ public function creates_unique_temporary_variables() {
1818
}
1919

2020
#[Test]
21-
public function writes_php_open_tag_as_default_preable() {
21+
public function writes_php_open_tag_as_default_preamble() {
2222
$out= new MemoryOutputStream();
2323
$r= new Result(new StringWriter($out));
2424
Assert::equals('<?php ', $out->bytes());
@@ -30,4 +30,12 @@ public function writes_preamble($preamble) {
3030
$r= new Result(new StringWriter($out), $preamble);
3131
Assert::equals($preamble, $out->bytes());
3232
}
33+
34+
#[Test]
35+
public function write() {
36+
$out= new MemoryOutputStream();
37+
$r= new Result(new StringWriter($out));
38+
$r->out->write('echo "Hello";');
39+
Assert::equals('<?php echo "Hello";', $out->bytes());
40+
}
3341
}

0 commit comments

Comments
 (0)