From 6af15640cef952aa90d76385724962a56253db8d Mon Sep 17 00:00:00 2001 From: Remi Collet Date: Thu, 28 Apr 2016 09:47:06 +0200 Subject: [PATCH] fix tests for php 5.5.35/5.6.21/7.0.6 --- tests/PHP/Shim/IntlTest.php | 2 +- tests/Utf8/HhvmTest.php | 2 +- tests/Utf8Test.php | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/tests/PHP/Shim/IntlTest.php b/tests/PHP/Shim/IntlTest.php index 1d4d4a7..6431349 100644 --- a/tests/PHP/Shim/IntlTest.php +++ b/tests/PHP/Shim/IntlTest.php @@ -122,7 +122,7 @@ public function testGrapheme_strpos() $this->assertSame(false, grapheme_strpos('abc', '')); $this->assertSame(false, grapheme_strpos('abc', 'd')); $this->assertSame(false, grapheme_strpos('abc', 'a', 3)); - $this->assertSame(0, grapheme_strpos('abc', 'a', -1)); + $this->assertFalse(grapheme_strpos('abc', 'a', -1)); $this->assertSame(1, grapheme_strpos('한국어', '국')); $this->assertSame(3, grapheme_stripos('DÉJÀ', 'à')); $this->assertSame(false, grapheme_strrpos('한국어', '')); diff --git a/tests/Utf8/HhvmTest.php b/tests/Utf8/HhvmTest.php index 8a77da0..1693fd0 100644 --- a/tests/Utf8/HhvmTest.php +++ b/tests/Utf8/HhvmTest.php @@ -12,7 +12,7 @@ public function test1() public function test2() { // Negative offset are not allowed but native PHP silently casts them to zero - $this->assertSame(0, grapheme_strpos('abc', 'a', -1)); + $this->assertFalse(grapheme_strpos('abc', 'a', -1)); } public function test3() diff --git a/tests/Utf8Test.php b/tests/Utf8Test.php index fec5a67..0df3947 100644 --- a/tests/Utf8Test.php +++ b/tests/Utf8Test.php @@ -173,7 +173,7 @@ public function testStrpos() $this->assertSame(false, u::strpos('abc', '')); $this->assertSame(false, u::strpos('abc', 'd')); $this->assertSame(false, u::strpos('abc', 'a', 3)); - $this->assertSame(0, u::strpos('abc', 'a', -1)); + $this->assertFalse(u::strpos('abc', 'a', -1)); $this->assertSame(1, u::strpos('한국어', '국')); $this->assertSame(3, u::stripos('DÉJÀ', 'à')); $this->assertSame(1, u::stripos('aςσb', 'ΣΣ'));