Add readPHPData() and writePHPData() to Storage class

This commit is contained in:
Kijin Sung 2016-03-20 19:22:59 +09:00
parent 820e29b5ba
commit 4fa3bf8cfb
2 changed files with 45 additions and 0 deletions

View file

@ -132,6 +132,15 @@ class StorageTest extends \Codeception\TestCase\Test
$this->assertEquals('foobarbazzjazz', file_get_contents($testfile));
}
public function testReadWritePHPData()
{
$testfile = \RX_BASEDIR . 'tests/_output/test.php';
$data = array('foo' => 'bar', 'baz' => array('rhymix' => '\'"special\\chars' . chr(0) . chr(255), 'test' => 'wow'));
$this->assertTrue(Rhymix\Framework\Storage::writePHPData($testfile, $data));
$this->assertEquals($data, Rhymix\Framework\Storage::readPHPData($testfile));
}
public function testCopy()
{
$source = \RX_BASEDIR . 'tests/_output/copy.source.txt';