3v4l.org

run code in 200+ php & hhvm versions
Bugs & Features
<?php class User { protected $name; protected $last_ip; public function __construct($name) { $this->name = $name; } public function setLastIp($ip) { $this->last_ip = $ip; } public function getLastIp() { return $this->last_ip; } } interface EntityManagerInterface { public function persist($entity); public function flush($entity = null); } interface UserManagerInterface { public function recordLogin(User $user,$ip); } class UserManagerTest extends PHPUnit_test_case { public function testRecordLogin() { $entity_manager = $this->getMockBuilder('EntityManagerInterface') ->expects($this->method('persist'))->once() ->expects($this->method('flush'))->once(); $test_user = new User('User name'); $test_ip = '127.111.111.111'; $test_manager = new UserManager($entity_manager); $test_manager->recordLogin($test_user, $test_ip); $this->assertEquals($test_ip, $test_user->getLastIp()); } }
Output for 7.0.0 - 7.2.0
Fatal error: Class 'PHPUnit_test_case' not found in /in/Nn76d on line 42
Process exited with code 255.
Output for 5.3.18 - 5.6.28
Fatal error: Class 'PHPUnit_test_case' not found in /in/Nn76d on line 43
Process exited with code 255.