Commit 345e6973 authored by Carsten  Rose's avatar Carsten Rose
Browse files

PhpUnit: fixed back some unit tests, which delivered different results under...

PhpUnit: fixed back some unit tests, which delivered different results under PHP5 (14.04) and PHP7 (16.04)
parent 17fa5102
......@@ -347,16 +347,16 @@ class EvaluateTest extends \AbstractDatabaseTest {
// LDAP_ESCAPE_FILTER => array('\\', '*', '(', ')', "\x00"),
// LDAP_ESCAPE_DN => array('\\', ',', '=', '+', '<', '>', ';', '"', '#'),
$this->store->setVar('a', ' hello world ', STORE_FORM, true);
$this->assertEquals('\20hello world\20', $eval->substitute('a:F:all:L', $foundInStore));
// $this->assertEquals(' hello world ', $eval->substitute('a:F:all:L', $foundInStore));
// $this->assertEquals('\20hello world\20', $eval->substitute('a:F:all:L', $foundInStore));
$this->assertEquals(' hello world ', $eval->substitute('a:F:all:L', $foundInStore));
$this->store->setVar('a', 'h\e,l=l+o< >w;o"r#ld', STORE_FORM, true);
$this->assertEquals('h\5ce\2cl\3dl\2bo\3c \3ew\3bo\22r\23ld', $eval->substitute('a:F:all:L', $foundInStore));
$this->store->setVar('a', ' hel;lo world ', STORE_FORM, true);
$this->assertEquals('\20hel\3blo world\20', $eval->substitute('a:F:all:sL', $foundInStore));
// $this->assertEquals(' hel\3blo world ', $eval->substitute('a:F:all:sL', $foundInStore));
// $this->assertEquals('\20hel\3blo world\20', $eval->substitute('a:F:all:sL', $foundInStore));
$this->assertEquals(' hel\3blo world ', $eval->substitute('a:F:all:sL', $foundInStore));
}
......
......@@ -151,8 +151,8 @@ class OnArrayTest extends \PHPUnit_Framework_TestCase {
$this->assertEquals(array(), OnArray::getArrayItemKeyNameStartWith(array(), ''));
$this->assertEquals(['a' => 'hello'], OnArray::getArrayItemKeyNameStartWith(['a' => 'hello'], ''));
$this->assertEquals(array(), OnArray::getArrayItemKeyNameStartWith(['a' => 'hello'], 'b'));
$this->assertEquals([0 => 'hello'], OnArray::getArrayItemKeyNameStartWith(['a' => 'hello'], 'a'));
// $this->assertEquals(['' => 'hello'], OnArray::getArrayItemKeyNameStartWith(['a' => 'hello'], 'a'));
// $this->assertEquals([0 => 'hello'], OnArray::getArrayItemKeyNameStartWith(['a' => 'hello'], 'a'));
$this->assertEquals(['' => 'hello'], OnArray::getArrayItemKeyNameStartWith(['a' => 'hello'], 'a'));
$this->assertEquals(['b' => 'hello'], OnArray::getArrayItemKeyNameStartWith(['ab' => 'hello'], 'a'));
$this->assertEquals(array(), OnArray::getArrayItemKeyNameStartWith(['ba' => 'hello'], 'a'));
$this->assertEquals(['a' => 'is', 'b' => 'john'], OnArray::getArrayItemKeyNameStartWith(['1_a' => 'my', '1_b' => 'name', '2_a' => 'is', '2_b' => 'john'], '2_'));
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment