Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- class Foo {
- public $name;
- public $age;
- public function __construct($name, $age) {
- }
- }
- class FooTest {
- /**
- * Will fail test with a single error "failed asserting $name = $foo->name"
- */
- public function testWithAssert($name, $age) {
- $foo = new Foo($name, $age);
- $this->assertEquals($age, $foo->name);
- $this->assertEquals($name, $foo->age);
- }
- /**
- * Will fail test two errors, one for name and one for age
- */
- public function testWithExpect($name, $age) {
- $foo = new Foo($name, $age);
- $this->expectEquals($age, $foo->name);
- $this->expectEquals($name, $foo->age);
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement