summaryrefslogtreecommitdiffstats
path: root/tests/codeigniter/helpers/file_helper_test.php
diff options
context:
space:
mode:
authorAndrew <browner12@gmail.com>2014-02-17 19:24:00 +0100
committerAndrew <browner12@gmail.com>2014-02-17 19:24:00 +0100
commit63cb46b94c4dda33e036643fbca3d94e0ba079f0 (patch)
treea8bc36fa23e3a7de491223c896d9aadaf4e8c408 /tests/codeigniter/helpers/file_helper_test.php
parentb6d8b962e44202a74c9b9321a4a53f61a753fccf (diff)
parentffe8aded4d2210759fce3427ed04893e6c655006 (diff)
Merge branch 'develop' into patch-1
Diffstat (limited to 'tests/codeigniter/helpers/file_helper_test.php')
-rw-r--r--tests/codeigniter/helpers/file_helper_test.php74
1 files changed, 35 insertions, 39 deletions
diff --git a/tests/codeigniter/helpers/file_helper_test.php b/tests/codeigniter/helpers/file_helper_test.php
index 3a6c73a5c..c31817595 100644
--- a/tests/codeigniter/helpers/file_helper_test.php
+++ b/tests/codeigniter/helpers/file_helper_test.php
@@ -31,9 +31,10 @@ class File_helper_Test extends CI_TestCase {
{
$content = 'Jack and Jill went up the mountain to fight a billy goat.';
- $file = vfsStream::newFile('my_file.txt', 0777)->withContent($content)
- ->lastModified(time() - 86400)
- ->at($this->_test_dir);
+ $file = vfsStream::newFile('my_file.txt', 0777)
+ ->withContent($content)
+ ->lastModified(time() - 86400)
+ ->at($this->_test_dir);
$this->assertEquals('777', octal_permissions($file->getPermissions()));
}
@@ -47,9 +48,10 @@ class File_helper_Test extends CI_TestCase {
{
$content = 'Jack and Jill went up the mountain to fight a billy goat.';
- $file = vfsStream::newFile('my_file.txt', 0777)->withContent($content)
- ->lastModified(time() - 86400)
- ->at($this->_test_dir);
+ $file = vfsStream::newFile('my_file.txt', 0777)
+ ->withContent($content)
+ ->lastModified(time() - 86400)
+ ->at($this->_test_dir);
$this->assertEquals('urwxrwxrwx', symbolic_permissions($file->getPermissions()));
}
@@ -60,9 +62,10 @@ class File_helper_Test extends CI_TestCase {
{
$content = 'Jack and Jill went up the mountain to fight a billy goat.';
- $file = vfsStream::newFile('my_file.txt', 0777)->withContent($content)
- ->lastModified(time() - 86400)
- ->at($this->_test_dir);
+ $file = vfsStream::newFile('my_file.txt', 0777)
+ ->withContent($content)
+ ->lastModified(time() - 86400)
+ ->at($this->_test_dir);
$this->assertEquals('text/plain', get_mime_by_extension(vfsStream::url('my_file.txt')));
@@ -103,19 +106,20 @@ class File_helper_Test extends CI_TestCase {
$content = 'Jack and Jill went up the mountain to fight a billy goat.';
$last_modified = time() - 86400;
- $file = vfsStream::newFile('my_file.txt', 0777)->withContent($content)
- ->lastModified($last_modified)
- ->at($this->_test_dir);
+ $file = vfsStream::newFile('my_file.txt', 0777)
+ ->withContent($content)
+ ->lastModified($last_modified)
+ ->at($this->_test_dir);
$ret_values = array(
- 'name' => 'my_file.txt',
- 'server_path' => 'vfs://my_file.txt',
- 'size' => 57,
- 'date' => $last_modified,
- 'readable' => TRUE,
- 'writable' => TRUE,
- 'executable' => TRUE,
- 'fileperms' => 33279
+ 'name' => 'my_file.txt',
+ 'server_path' => 'vfs://my_file.txt',
+ 'size' => 57,
+ 'date' => $last_modified,
+ 'readable' => TRUE,
+ 'writable' => TRUE,
+ 'executable' => TRUE,
+ 'fileperms' => 33279
);
$info = get_file_info(vfsStream::url('my_file.txt'), $vals);
@@ -128,24 +132,16 @@ class File_helper_Test extends CI_TestCase {
// --------------------------------------------------------------------
- // Skipping for now, as it's not implemented in vfsStreamWrapper
- // flock(): vfsStreamWrapper::stream_lock is not implemented!
-
- // public function test_write_file()
- // {
- // if ( ! defined('FOPEN_WRITE_CREATE_DESTRUCTIVE'))
- // {
- // define('FOPEN_WRITE_CREATE_DESTRUCTIVE', 'wb');
- // }
- //
- // $content = 'Jack and Jill went up the mountain to fight a billy goat.';
- //
- // $file = vfsStream::newFile('write.txt', 0777)->withContent('')
- // ->lastModified(time() - 86400)
- // ->at($this->_test_dir);
- //
- // $this->assertTrue(write_file(vfsStream::url('write.txt'), $content));
- //
- // }
+ public function test_write_file()
+ {
+ $content = 'Jack and Jill went up the mountain to fight a billy goat.';
+
+ $file = vfsStream::newFile('write.txt', 0777)
+ ->withContent('')
+ ->lastModified(time() - 86400)
+ ->at($this->_test_dir);
+
+ $this->assertTrue(write_file(vfsStream::url('write.txt'), $content));
+ }
} \ No newline at end of file