<?php
namespace TobiasGies;
class HHVMCompatibilityTest extends \PHPUnit_Framework_TestCase {
public function testCreateDummyWithDisabledConstructor() {
$mock = $this
->getMockBuilder('TobiasGies\HHVMCompatibilityTest_Dummy')
->disableOriginalConstructor()
->getMock();
$this->assertNotEquals('__PHP_Unserializable_Class', get_class($mock));
$this->assertInstanceOf('TobiasGies\HHVMCompatibilityTest_Dummy', $mock);
}
public function testCreateDOMDocumentWithDisabledConstructor() {
$mock = $this
->getMockBuilder('DOMDocument')
->disableOriginalConstructor()
->getMock();
$this->assertNotEquals('__PHP_Unserializable_Class', get_class($mock));
$this->assertInstanceOf('DOMDocument', $mock);
}
}
class HHVMCompatibilityTest_Dummy {
private $foo;
public function __construct($foo) {
$this->foo = $foo;
}
}
$ /usr/bin/php --version
PHP 5.5.9-1+sury.org~saucy+1 (cli) (built: Feb 13 2014 15:58:58)
Copyright (c) 1997-2014 The PHP Group
Zend Engine v2.5.0, Copyright (c) 1998-2014 Zend Technologies
with Zend OPcache v7.0.3, Copyright (c) 1999-2014, by Zend Technologies
with Xdebug v2.2.3, Copyright (c) 2002-2013, by Derick Rethans
$ /usr/bin/php ~/phar/phpunit.phar HHVMCompatibilityTest.php
PHPUnit 4.0.12 by Sebastian Bergmann.
..
Time: 40 ms, Memory: 3.75Mb
OK (2 tests, 4 assertions)
$ /usr/bin/hhvm --version
HipHop VM 2.4.2 (rel)
Compiler: tags/HHVM-2.4.2-0-g432ecffa04b21c60953bb236a9db8278f4650537
Repo schema: 1be260b29a71097b5d1f78c6e4dcbb981ba03bde
$ /usr/bin/hhvm ~/phar/phpunit.phar HHVMCompatibilityTest.php
PHPUnit 4.0.12 by Sebastian Bergmann.
.F
Time: 84 ms, Memory: 10.89Mb
There was 1 failure:
1) TobiasGies\HHVMCompatibilityTest::testCreateDOMDocumentWithDisabledConstructor
Failed asserting that '__PHP_Unserializable_Class' is not equal to <string:__PHP_Unserializable_Class>.
/home/tobias/sources/playground/HHVMCompatibilityTest.php:20
FAILURES!
Tests: 2, Assertions: 3, Failures: 1.
$ ~/sources/hhvm/hphp/hhvm/hhvm --version
HipHop VM 3.0.0-dev (rel)
Compiler: heads/master-0-g5b00837d9b2ecc28e6225336296be88449637b2e
Repo schema: b602fe3a78ec9eec7b65ec874110b9323ceabf88
$ ~/sources/hhvm/hphp/hhvm/hhvm ~/phar/phpunit.phar HHVMCompatibilityTest.php
PHPUnit 4.0.12 by Sebastian Bergmann.
.F
Time: 418 ms, Memory: 11.69Mb
There was 1 failure:
1) TobiasGies\HHVMCompatibilityTest::testCreateDOMDocumentWithDisabledConstructor
Failed asserting that '__PHP_Unserializable_Class' is not equal to <string:__PHP_Unserializable_Class>.
/home/tobias/sources/playground/HHVMCompatibilityTest.php:20
FAILURES!
Tests: 2, Assertions: 3, Failures: 1.