Skip to content
This repository has been archived by the owner on Jan 8, 2020. It is now read-only.

Commit

Permalink
#6730 #6761 - config reader should disallow opening non existing files
Browse files Browse the repository at this point in the history
  • Loading branch information
Ocramius committed Dec 31, 2014
1 parent 6da99b0 commit 83d0489
Showing 1 changed file with 24 additions and 0 deletions.
24 changes: 24 additions & 0 deletions tests/ZendTest/Config/Reader/XmlTest.php
Expand Up @@ -14,6 +14,8 @@

/**
* @group Zend_Config
*
* @covers \Zend\Config\Reader\Xml
*/
class XmlTest extends AbstractReaderTestCase
{
Expand Down Expand Up @@ -123,6 +125,28 @@ public function testElementWithBothAttributesAndAStringValueIsProcessedCorrectly
$this->assertEquals('bazbat', $arrayXml['one'][1]['_']);
}

/**
* @group 6761
* @group 6730
*/
public function testReadRemovedFilesWillFailWithException()
{
$configReader = new Xml();

$asset = $this->getTestAssetPath('attributes');
$tmpAssetPath = tempnam(sys_get_temp_dir(), 'attributesTestAsset');

copy($asset, $tmpAssetPath);

$configReader->fromFile($tmpAssetPath);

unlink($tmpAssetPath);

$this->setExpectedException('Zend\Config\Exception\RuntimeException');

$configReader->fromFile($tmpAssetPath);
}

/**
* @group 6761
* @group 6730
Expand Down

0 comments on commit 83d0489

Please sign in to comment.