Permalink
Browse files

Merge branch 'hotfix/5369'

Close #5369
  • Loading branch information...
2 parents e69e32a + cd4ab44 commit e0ee2ea05883a7f7460aa41d7862dd04921ac436 @weierophinney weierophinney committed Oct 30, 2013
@@ -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);
}
}
@@ -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;
@@ -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));
}
/**
@@ -103,6 +103,7 @@ public function testGetSqlString()
DROP CONSTRAINT "my_index"
EOS;
+ $expected = str_replace("\r\n", "\n", $expected);
$this->assertEquals($expected, $at->getSqlString());
}
}
@@ -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()
@@ -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()
@@ -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()
@@ -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');
@@ -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);
}
@@ -22,7 +22,7 @@ public function setUp()
$this->markTestSkipped('This adapter needs the zip extension');
}
- $this->tmp = sys_get_temp_dir() . '/' . str_replace('\\', '_', __CLASS__);
+ $this->tmp = sys_get_temp_dir() . DIRECTORY_SEPARATOR . str_replace('\\', '_', __CLASS__);
$files = array(
$this->tmp . '/compressed.zip',
@@ -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));
}
/**
@@ -66,9 +66,9 @@ public function setUp()
mkdir($this->_filesPath);
mkdir($this->_newDir);
- $this->_oldFile = $this->_filesPath . '/testfile.txt';
- $this->_newFile = $this->_filesPath . '/newfile.xml';
- $this->_newDirFile = $this->_newDir . '/testfile.txt';
+ $this->_oldFile = $this->_filesPath . DIRECTORY_SEPARATOR . 'testfile.txt';
+ $this->_newFile = $this->_filesPath . DIRECTORY_SEPARATOR . 'newfile.xml';
+ $this->_newDirFile = $this->_newDir . DIRECTORY_SEPARATOR . 'testfile.txt';
touch($this->_oldFile);
}
@@ -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));
}
/**
@@ -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;

0 comments on commit e0ee2ea

Please sign in to comment.