Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Merge branch 'hotfix/5369' into develop

Forward port #5369
  • Loading branch information...
commit face1aa10ce2e45821006c5c4103a62a8482f5fc 2 parents 75d3b80 + cd4ab44
@weierophinney weierophinney authored
View
2  tests/ZendTest/Config/Writer/XmlTest.php
@@ -42,6 +42,7 @@ public function testToString()
ECS;
+ $expected = str_replace("\r\n", "\n", $expected);
$this->assertEquals($expected, $configString);
}
@@ -78,6 +79,7 @@ public function testSectionsToString()
ECS;
+ $expected = str_replace("\r\n", "\n", $expected);
$this->assertEquals($expected, $configString);
}
}
View
18 tests/ZendTest/Console/Prompt/NumberTest.php
@@ -48,8 +48,8 @@ public function testCanReadNumber()
public function testCanReadNumberOnMultilign()
{
- fwrite($this->adapter->stream, "a\n");
- fwrite($this->adapter->stream, "123\n");
+ fwrite($this->adapter->stream, "a" . PHP_EOL);
+ fwrite($this->adapter->stream, "123" . PHP_EOL);
rewind($this->adapter->stream);
$this->adapter->autoRewind = false;
@@ -64,8 +64,8 @@ public function testCanReadNumberOnMultilign()
public function testCanNotReadFloatByDefault()
{
- fwrite($this->adapter->stream, "1.23\n");
- fwrite($this->adapter->stream, "123\n");
+ fwrite($this->adapter->stream, "1.23" . PHP_EOL);
+ fwrite($this->adapter->stream, "123" . PHP_EOL);
rewind($this->adapter->stream);
$this->adapter->autoRewind = false;
@@ -80,8 +80,8 @@ public function testCanNotReadFloatByDefault()
public function testCanForceToReadFloat()
{
- fwrite($this->adapter->stream, "1.23\n");
- fwrite($this->adapter->stream, "123\n");
+ fwrite($this->adapter->stream, "1.23" . PHP_EOL);
+ fwrite($this->adapter->stream, "123" . PHP_EOL);
rewind($this->adapter->stream);
$this->adapter->autoRewind = false;
@@ -96,9 +96,9 @@ public function testCanForceToReadFloat()
public function testCanDefineAMax()
{
- fwrite($this->adapter->stream, "1\n");
- fwrite($this->adapter->stream, "11\n");
- fwrite($this->adapter->stream, "6\n");
+ fwrite($this->adapter->stream, "1" . PHP_EOL);
+ fwrite($this->adapter->stream, "11" . PHP_EOL);
+ fwrite($this->adapter->stream, "6" . PHP_EOL);
rewind($this->adapter->stream);
$this->adapter->autoRewind = false;
View
14 tests/ZendTest/Crypt/Key/Derivation/ScryptTest.php
@@ -49,12 +49,12 @@ public function testVectorSalsa208Core()
}
$salsa20 = self::getMethod($salsaAlg);
$obj = $this->getMockForAbstractClass('Zend\Crypt\Key\Derivation\Scrypt');
- $input = self::hex2bin(str_replace(array(' ',"\n"),'',$hexInput));
+ $input = self::hex2bin(str_replace(array(' ',PHP_EOL),'',$hexInput));
$result = $salsa20->invokeArgs($obj, array($input));
$this->assertEquals(64, strlen($input), 'Input must be a string of 64 bytes');
$this->assertEquals(64, strlen($result), 'Output must be a string of 64 bytes');
- $this->assertEquals(str_replace(array(' ',"\n"),'',$hexOutput), bin2hex($result));
+ $this->assertEquals(str_replace(array(' ',PHP_EOL),'',$hexOutput), bin2hex($result));
}
/**
* Test vector of Scrypt BlockMix
@@ -85,10 +85,10 @@ public function testVectorScryptBlockMix()
$blockMix = self::getMethod('scryptBlockMix');
$obj = $this->getMockForAbstractClass('Zend\Crypt\Key\Derivation\Scrypt');
- $input = self::hex2bin(str_replace(array(' ',"\n"), '', $hexInput));
+ $input = self::hex2bin(str_replace(array(' ',PHP_EOL), '', $hexInput));
$result = $blockMix->invokeArgs($obj, array($input, 1));
- $this->assertEquals(str_replace(array(' ',"\n"),'',$hexOutput), bin2hex($result));
+ $this->assertEquals(str_replace(array(' ',PHP_EOL),'',$hexOutput), bin2hex($result));
}
/**
@@ -119,10 +119,10 @@ public function testVectorScryptROMix()
$roMix = self::getMethod('scryptROMix');
$obj = $this->getMockForAbstractClass('Zend\Crypt\Key\Derivation\Scrypt');
- $input = self::hex2bin(str_replace(array(' ',"\n"), '', $hexInput));
+ $input = self::hex2bin(str_replace(array(' ',PHP_EOL), '', $hexInput));
$result = $roMix->invokeArgs($obj, array($input, 16, 1));
- $this->assertEquals(str_replace(array(' ',"\n"),'',$hexOutput), bin2hex($result));
+ $this->assertEquals(str_replace(array(' ',PHP_EOL),'',$hexOutput), bin2hex($result));
}
@@ -140,7 +140,7 @@ public function testVectorScrypt()
$result = Scrypt::calc('', '', 16, 1, 1, 64);
$this->assertEquals(64, strlen($result));
- $this->assertEquals(str_replace(array(' ',"\n"),'',$hexOutput), bin2hex($result));
+ $this->assertEquals(str_replace(array(' ',PHP_EOL),'',$hexOutput), bin2hex($result));
}
/**
View
1  tests/ZendTest/Db/Sql/Ddl/AlterTableTest.php
@@ -103,6 +103,7 @@ public function testGetSqlString()
DROP CONSTRAINT "my_index"
EOS;
+ $expected = str_replace("\r\n", "\n", $expected);
$this->assertEquals($expected, $at->getSqlString());
}
}
View
4 tests/ZendTest/Feed/Reader/Entry/CommonTest.php
@@ -72,7 +72,9 @@ public function testSaveXmlOutputsXmlStringForEntry()
file_get_contents($this->feedSamplePath.'/atom.xml')
);
$entry = $feed->current();
- $this->assertEquals($entry->saveXml(), file_get_contents($this->feedSamplePath.'/atom_rewrittenbydom.xml'));
+ $expected = file_get_contents($this->feedSamplePath.'/atom_rewrittenbydom.xml');
+ $expected = str_replace("\r\n", "\n", $expected);
+ $this->assertEquals($expected, $entry->saveXml());
}
public function testGetsNamedExtension()
View
4 tests/ZendTest/Feed/Reader/Feed/CommonTest.php
@@ -66,7 +66,9 @@ public function testSaveXmlOutputsXmlStringForFeed()
$feed = Reader\Reader::importString(
file_get_contents($this->feedSamplePath.'/atom.xml')
);
- $this->assertEquals($feed->saveXml(), file_get_contents($this->feedSamplePath.'/atom_rewrittenbydom.xml'));
+ $expected = file_get_contents($this->feedSamplePath.'/atom_rewrittenbydom.xml');
+ $expected = str_replace("\r\n", "\n", $expected);
+ $this->assertEquals($expected, $feed->saveXml());
}
public function testGetsNamedExtension()
View
24 tests/ZendTest/Feed/Reader/Integration/PodcastRss2Test.php
@@ -96,10 +96,12 @@ public function testGetsDescription()
$feed = Reader\Reader::importString(
file_get_contents($this->feedSamplePath)
);
- $this->assertEquals('All About Everything is a show about everything.
+ $expected = 'All About Everything is a show about everything.
Each week we dive into any subject known to man and talk
about it as much as we can. Look for our Podcast in the
- iTunes Store', $feed->getDescription());
+ iTunes Store';
+ $expected = str_replace("\r\n", "\n", $expected);
+ $this->assertEquals($expected, $feed->getDescription());
}
public function testGetsLanguage()
@@ -205,8 +207,10 @@ public function testGetsSubtitle()
file_get_contents($this->feedSamplePath)
);
$entry = $feed->current();
- $this->assertEquals('A short primer on table spices
- ', $entry->getSubtitle());
+ $expected = 'A short primer on table spices
+ ';
+ $expected = str_replace("\r\n", "\n", $expected);
+ $this->assertEquals($expected, $entry->getSubtitle());
}
public function testGetsSummary()
@@ -215,10 +219,12 @@ public function testGetsSummary()
file_get_contents($this->feedSamplePath)
);
$entry = $feed->current();
- $this->assertEquals('This week we talk about salt and pepper
+ $expected = 'This week we talk about salt and pepper
shakers, comparing and contrasting pour rates,
construction materials, and overall aesthetics. Come and
- join the party!', $entry->getSummary());
+ join the party!';
+ $expected = str_replace("\r\n", "\n", $expected);
+ $this->assertEquals($expected, $entry->getSummary());
}
public function testGetsDuration()
@@ -236,8 +242,10 @@ public function testGetsKeywords()
file_get_contents($this->feedSamplePath)
);
$entry = $feed->current();
- $this->assertEquals('salt, pepper, shaker, exciting
- ', $entry->getKeywords());
+ $expected = 'salt, pepper, shaker, exciting
+ ';
+ $expected = str_replace("\r\n", "\n", $expected);
+ $this->assertEquals($expected, $entry->getKeywords());
}
public function testGetsEntryEncoding()
View
5 tests/ZendTest/Feed/Reader/ReaderTest.php
@@ -264,6 +264,11 @@ public function testRegistersUserExtension()
$this->assertTrue(Reader\Reader::isRegistered('JungleBooks'));
}
+ /**
+ * This test is failing on windows:
+ * Failed asserting that exception of type "Zend\Feed\Reader\Exception\RuntimeException" matches expected exception "Zend\Feed\Reader\Exception\InvalidArgumentException". Message was: "DOMDocument cannot parse XML: Entity 'discloseInfo' failed to parse".
+ * @todo why is the assertEquals commented out?
+ */
public function testXxePreventionOnFeedParsing()
{
$this->setExpectedException('Zend\Feed\Reader\Exception\InvalidArgumentException');
View
2  tests/ZendTest/Feed/Writer/FeedTest.php
@@ -1021,6 +1021,7 @@ public function testExportRss()
EOT;
$feed = str_replace('%version%', Version::VERSION, $feed);
+ $feed = str_replace("\r\n", "\n", $feed);
$this->assertEquals($feed, $export);
}
@@ -1042,6 +1043,7 @@ public function testExportRssIgnoreExceptions()
EOT;
$feed = str_replace('%version%', Version::VERSION, $feed);
+ $feed = str_replace("\r\n", "\n", $feed);
$this->assertEquals($feed, $export);
}
View
4 tests/ZendTest/Filter/File/RenameTest.php
@@ -491,7 +491,7 @@ public function testGetRandomizedFile()
$filter->getFile()
);
$fileNoExt = $this->_filesPath . 'newfile';
- $this->assertRegExp('#' . $fileNoExt . '_.{13}\.xml#', $filter->getNewName($this->_oldFile));
+ $this->assertRegExp('#' . str_replace('\\', '\\\\', $fileNoExt) . '_.{13}\.xml#', $filter->getNewName($this->_oldFile));
}
/**
@@ -515,7 +515,7 @@ public function testGetRandomizedFileWithoutExtension()
)),
$filter->getFile()
);
- $this->assertRegExp('#' . $fileNoExt . '_.{13}#', $filter->getNewName($this->_oldFile));
+ $this->assertRegExp('#' . str_replace('\\', '\\\\', $fileNoExt) . '_.{13}#', $filter->getNewName($this->_oldFile));
}
/**
View
16 tests/ZendTest/Filter/File/RenameUploadTest.php
@@ -245,18 +245,18 @@ public function testCannotOverwriteExistingFile()
*/
public function testGetRandomizedFile()
{
- $fileNoExt = $this->_filesPath . '/newfile';
+ $fileNoExt = $this->_filesPath . DIRECTORY_SEPARATOR . 'newfile';
$filter = new RenameUploadMock(array(
'target' => $this->_newFile,
'randomize' => true,
));
- $this->assertRegExp('#' . $fileNoExt . '_.{13}\.xml#', $filter($this->_oldFile));
+ $this->assertRegExp('#' . str_replace('\\', '\\\\', $fileNoExt) . '_.{13}\.xml#', $filter($this->_oldFile));
}
public function testGetFileWithOriginalExtension()
{
- $fileNoExt = $this->_filesPath . '/newfile';
+ $fileNoExt = $this->_filesPath . DIRECTORY_SEPARATOR . 'newfile';
$filter = new RenameUploadMock(array(
'target' => $this->_newFile,
'use_upload_extension' => true,
@@ -266,14 +266,14 @@ public function testGetFileWithOriginalExtension()
$oldFilePathInfo = pathinfo($this->_oldFile);
$this->assertRegExp(
- '#' . $fileNoExt . '.'.$oldFilePathInfo['extension'].'#',
+ '#' . str_replace('\\', '\\\\', $fileNoExt) . '.'.$oldFilePathInfo['extension'].'#',
$filter($this->_oldFile)
);
}
public function testGetRandomizedFileWithOriginalExtension()
{
- $fileNoExt = $this->_filesPath . '/newfile';
+ $fileNoExt = $this->_filesPath . DIRECTORY_SEPARATOR . 'newfile';
$filter = new RenameUploadMock(array(
'target' => $this->_newFile,
'use_upload_extension' => true,
@@ -283,7 +283,7 @@ public function testGetRandomizedFileWithOriginalExtension()
$oldFilePathInfo = pathinfo($this->_oldFile);
$this->assertRegExp(
- '#' . $fileNoExt . '_.{13}\.'.$oldFilePathInfo['extension'].'#',
+ '#' . str_replace('\\', '\\\\', $fileNoExt) . '_.{13}\.'.$oldFilePathInfo['extension'].'#',
$filter($this->_oldFile)
);
}
@@ -293,13 +293,13 @@ public function testGetRandomizedFileWithOriginalExtension()
*/
public function testGetRandomizedFileWithoutExtension()
{
- $fileNoExt = $this->_filesPath . '/newfile';
+ $fileNoExt = $this->_filesPath . DIRECTORY_SEPARATOR . 'newfile';
$filter = new RenameUploadMock(array(
'target' => $fileNoExt,
'randomize' => true,
));
- $this->assertRegExp('#' . $fileNoExt . '_.{13}#', $filter($this->_oldFile));
+ $this->assertRegExp('#' . str_replace('\\', '\\\\', $fileNoExt) . '_.{13}#', $filter($this->_oldFile));
}
/**
View
8 tests/ZendTest/Soap/ClientTest.php
@@ -11,14 +11,6 @@
require_once __DIR__ . '/TestAsset/commontypes.php';
-//if soap exension is not loaded, this will avoid two notices in the test runner suite
-if(!defined('SOAP_ENCODED')){
- define ('SOAP_ENCODED', 1);
-}
-if(!defined('SOAP_DOCUMENT')){
- define ('SOAP_DOCUMENT', 2);
-}
-
use Zend\Soap\AutoDiscover;
use Zend\Soap\Client;
use Zend\Soap\Server;
Please sign in to comment.
Something went wrong with that request. Please try again.