Skip to content

Commit 688a046

Browse files
committed
Add two basic tests
1 parent d103104 commit 688a046

File tree

2 files changed

+47
-0
lines changed

2 files changed

+47
-0
lines changed
Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
--TEST--
2+
Protocol Basic Error
3+
--FILE--
4+
<?php
5+
6+
class Foo {
7+
public function bar($abc) {}
8+
}
9+
interface Bar {
10+
public function bar();
11+
}
12+
13+
function foo(<Bar> $bar) {
14+
var_dump($bar);
15+
}
16+
17+
foo(new Foo);
18+
?>
19+
--EXPECTF--
20+
Catchable fatal error: Argument 1 passed to foo() must look like Bar, instance of Foo given, called in %s/basic_errors.php on line %d and defined in %s/basic_errors.php on line %d
Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
--TEST--
2+
Protocol Basic Functionality
3+
--FILE--
4+
<?php
5+
6+
class Foo implements Bar {
7+
public function bar() {}
8+
}
9+
class Baz {
10+
public function bar() {}
11+
}
12+
interface Bar {
13+
public function bar();
14+
}
15+
16+
function foo(<Bar> $bar) {
17+
var_dump($bar);
18+
}
19+
20+
foo(new Foo);
21+
foo(new Baz);
22+
?>
23+
--EXPECT--
24+
object(Foo)#1 (0) {
25+
}
26+
object(Baz)#1 (0) {
27+
}

0 commit comments

Comments
 (0)