Browse Source

All tests executing without fatals under hhvm

Jose Lorenzo Rodriguez 12 years ago
parent
commit
1ad430464e

+ 1 - 1
.travis.yml

@@ -40,7 +40,7 @@ before_script:
   - set +H
 
 script:
-  - sh -c "if [ '$PHPCS' != '1' ] && [ '$HHVM' != '1' ]; then phpunit --stderr; elif [ '$PHPCS' != '1' ] && [ '$HHVM' = '1' ]; then phpunit --testsuite HHVM; else phpcs -p --extensions=php --standard=CakePHP ./src ./tests; fi"
+  - sh -c "if [ '$PHPCS' != '1' ]; then phpunit --stderr; else phpcs -p --extensions=php --standard=CakePHP ./src ./tests; fi"
 
 notifications:
   email: false

+ 0 - 12
phpunit.xml.dist

@@ -23,18 +23,6 @@
 		<testsuite name="Database Test Suite">
 			<file>./tests/TestCase/DatabaseSuite.php</file>
 		</testsuite>
-		<testsuite name="HHVM">
-			<file>./tests/TestCase/DatabaseSuite.php</file>
-			<directory>./tests/TestCase/Collection</directory>
-			<directory>./tests/TestCase/Configure</directory>
-			<directory>./tests/TestCase/Controller</directory>
-			<directory>./tests/TestCase/Event</directory>
-			<directory>./tests/TestCase/I18n</directory>
-			<directory>./tests/TestCase/Log</directory>
-			<directory>./tests/TestCase/Routing</directory>
-			<directory>./tests/TestCase/TestSuite</directory>
-			<directory>./tests/TestCase/Validation</directory>
-		</testsuite>
 	</testsuites>
 	<listeners>
 		<listener class="\Cake\TestSuite\Fixture\FixtureInjector" file="./src/TestSuite/Fixture/FixtureInjector.php">

+ 4 - 4
tests/TestCase/Collection/CollectionTest.php

@@ -73,7 +73,7 @@ class CollectionTest extends TestCase {
  * @return void
  */
 	public function testFilterChaining() {
-		$this->skipIf(defined('HHVM_VERSION'), 'Broken on HHVM');
+		$this->assertFalse(defined('HHVM_VERSION'), 'Broken on HHVM');
 		$items = ['a' => 1, 'b' => 2, 'c' => 3];
 		$collection = new Collection($items);
 		$callable = $this->getMock('stdClass', ['__invoke']);
@@ -94,7 +94,7 @@ class CollectionTest extends TestCase {
  * @return void
  */
 	public function testReject() {
-		$this->skipIf(defined('HHVM_VERSION'), 'Broken on HHVM');
+		$this->assertFalse(defined('HHVM_VERSION'), 'Broken on HHVM');
 		$items = ['a' => 1, 'b' => 2, 'c' => 3];
 		$collection = new Collection($items);
 		$result = $collection->reject(function ($v, $k, $items) use ($collection) {
@@ -545,7 +545,7 @@ class CollectionTest extends TestCase {
  * @return void
  */
 	public function testMatch() {
-		$this->skipIf(defined('HHVM_VERSION'), 'Broken on HHVM');
+		$this->assertFalse(defined('HHVM_VERSION'), 'Broken on HHVM');
 		$items = [
 			['id' => 1, 'name' => 'foo', 'thing' => ['parent_id' => 10]],
 			['id' => 2, 'name' => 'bar', 'thing' => ['parent_id' => 11]],
@@ -574,7 +574,7 @@ class CollectionTest extends TestCase {
  * @return void
  */
 	public function testFirstMatch() {
-		$this->skipIf(defined('HHVM_VERSION'), 'Broken on HHVM');
+		$this->assertFalse(defined('HHVM_VERSION'), 'Broken on HHVM');
 		$items = [
 			['id' => 1, 'name' => 'foo', 'thing' => ['parent_id' => 10]],
 			['id' => 2, 'name' => 'bar', 'thing' => ['parent_id' => 11]],

+ 1 - 1
tests/TestCase/Collection/Iterator/FilterIteratorTest.php

@@ -29,7 +29,7 @@ class FilterIteratorTest extends TestCase {
  * @return void
  */
 	public function testFilter() {
-		$this->skipIf(defined('HHVM_VERSION'), 'Broken on HHVM');
+		$this->assertFalse(defined('HHVM_VERSION'), 'Broken on HHVM');
 		$items = new \ArrayIterator([1, 2, 3]);
 		$callable = $this->getMock('stdClass', ['__invoke']);
 		$callable->expects($this->at(0))

+ 6 - 0
tests/TestCase/Network/SocketTest.php

@@ -257,6 +257,7 @@ class SocketTest extends TestCase {
  * @return void
  */
 	public function testEnableCryptoSocketExceptionNoTls() {
+		$this->assertFalse(defined('HHVM_VERSION'), 'Broken on HHVM');
 		$configNoSslOrTls = array('host' => 'localhost', 'port' => 80, 'timeout' => 0.1);
 
 		// testing exception on no ssl socket server for ssl and tls methods
@@ -288,6 +289,7 @@ class SocketTest extends TestCase {
  * @return void
  */
 	public function testEnableCryptoBadMode() {
+		$this->assertFalse(defined('HHVM_VERSION'), 'Broken on HHVM');
 		// testing wrong encryption mode
 		$this->_connectSocketToSslTls();
 		$this->Socket->enableCrypto('doesntExistMode', 'server');
@@ -300,6 +302,7 @@ class SocketTest extends TestCase {
  * @return void
  */
 	public function testEnableCrypto() {
+		$this->assertFalse(defined('HHVM_VERSION'), 'Broken on HHVM');
 		// testing on ssl server
 		$this->_connectSocketToSslTls();
 		$this->assertTrue($this->Socket->enableCrypto('sslv3', 'client'));
@@ -318,6 +321,7 @@ class SocketTest extends TestCase {
  * @return void
  */
 	public function testEnableCryptoExceptionEnableTwice() {
+		$this->assertFalse(defined('HHVM_VERSION'), 'Broken on HHVM');
 		// testing on tls server
 		$this->_connectSocketToSslTls();
 		$this->Socket->enableCrypto('tls', 'client');
@@ -331,6 +335,7 @@ class SocketTest extends TestCase {
  * @return void
  */
 	public function testEnableCryptoExceptionDisableTwice() {
+		$this->assertFalse(defined('HHVM_VERSION'), 'Broken on HHVM');
 		// testing on tls server
 		$this->_connectSocketToSslTls();
 		$this->Socket->enableCrypto('tls', 'client', false);
@@ -342,6 +347,7 @@ class SocketTest extends TestCase {
  * @return void
  */
 	public function testEnableCryptoEnableStatus() {
+		$this->assertFalse(defined('HHVM_VERSION'), 'Broken on HHVM');
 		// testing on tls server
 		$this->_connectSocketToSslTls();
 		$this->assertFalse($this->Socket->encrypted);

+ 1 - 0
tests/TestCase/Utility/XmlTest.php

@@ -47,6 +47,7 @@ class XmlTest extends TestCase {
  * @return void
  */
 	public function setUp() {
+		$this->assertFalse(defined('HHVM_VERSION'), 'Causes segfault on HHVM');
 		parent::setUp();
 		$this->_appEncoding = Configure::read('App.encoding');
 		Configure::write('App.encoding', 'UTF-8');