Skip to content

Commit

Permalink
tests adjustments
Browse files Browse the repository at this point in the history
- fixed tests sensitive to line endings in test files (expected CRLF)
- BC Zend_Amf_RequestTest fix from diablomedia/zf1@ba8cf7a#diff-68d7be0100c43bc2df55377c9d27cd05
  • Loading branch information
falkenhawk committed May 20, 2019
1 parent 8604d53 commit 5f7a2c6
Show file tree
Hide file tree
Showing 4 changed files with 13 additions and 1 deletion.
9 changes: 8 additions & 1 deletion tests/Zend/Amf/RequestTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -433,7 +433,14 @@ public function testAmf0MixedArrayParameterDeserializedToNativePhpObject()
$this->assertTrue($bodies[0] instanceof Zend_Amf_Value_MessageBody);
$data = $bodies[0]->getData();
// Make sure that the string was deserialized properly and check its value
$this->assertTrue(property_exists($data[0], 1));
// In PHP versions less than 7, get_object_vars doesn't return numerical
// keys. In PHP 7.2+ array_key_exists on this particular object returns false
// https://3v4l.org/ui8Fm
if (version_compare(PHP_VERSION, '7.0.0', '>=')) {
$this->assertTrue(array_key_exists(1, get_object_vars($data[0])));
} else {
$this->assertTrue(array_key_exists(1, $data[0]));
}
$this->assertEquals('two', $data[0]->two);
}

Expand Down
2 changes: 2 additions & 0 deletions tests/Zend/Http/_files/.gitattributes
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
response_chunked eol=crlf
response_chunked_case eol=crlf
2 changes: 2 additions & 0 deletions tests/Zend/Mail/_files/test.mbox/.gitattributes
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
INBOX eol=crlf
subfolder/* eol=crlf
1 change: 1 addition & 0 deletions tests/Zend/XmlRpc/_files/.gitattributes
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
ZF1897-response-chunked.txt eol=crlf

0 comments on commit 5f7a2c6

Please sign in to comment.