Skip to content

Commit 5880851

Browse files
committed
Add tests for CompileOnly class
1 parent 5ef55fa commit 5880851

File tree

2 files changed

+24
-1
lines changed

2 files changed

+24
-1
lines changed
Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
<?php namespace lang\ast\unittest\cli;
2+
3+
use unittest\Test;
4+
use xp\compiler\CompileOnly;
5+
6+
class CompileOnlyTest {
7+
8+
#[Test]
9+
public function can_create() {
10+
new CompileOnly();
11+
}
12+
13+
#[Test]
14+
public function write_to_stream() {
15+
$fixture= new CompileOnly();
16+
with ($fixture->target('Test.php'), function($out) {
17+
$out->write('<?php class Test { }');
18+
$out->flush();
19+
$out->close();
20+
});
21+
$fixture->close();
22+
}
23+
}

src/test/php/lang/ast/unittest/cli/ToStreamTest.class.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
<?php namespace lang\ast\unittest\cli;
22

33
use io\streams\MemoryOutputStream;
4-
use unittest\{After, Assert, Before, Test};
4+
use unittest\{Assert, Test};
55
use xp\compiler\ToStream;
66

77
class ToStreamTest {

0 commit comments

Comments
 (0)