From 979e8d1619e26adc1bdd6f75cc04b2981e100942 Mon Sep 17 00:00:00 2001 From: Alexander Makarov Date: Sun, 17 Nov 2013 04:19:57 +0400 Subject: [PATCH] Replaced assertTrue(file_exists with assertFileExists in FileHelperTest --- tests/unit/framework/helpers/FileHelperTest.php | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/tests/unit/framework/helpers/FileHelperTest.php b/tests/unit/framework/helpers/FileHelperTest.php index 3fde06e..1804d5e 100644 --- a/tests/unit/framework/helpers/FileHelperTest.php +++ b/tests/unit/framework/helpers/FileHelperTest.php @@ -126,10 +126,10 @@ class FileHelperTest extends TestCase FileHelper::copyDirectory($srcDirName, $dstDirName); - $this->assertTrue(file_exists($dstDirName), 'Destination directory does not exist!'); + $this->assertFileExists($dstDirName, 'Destination directory does not exist!'); foreach ($files as $name => $content) { $fileName = $dstDirName . DIRECTORY_SEPARATOR . $name; - $this->assertTrue(file_exists($fileName), 'Directory file is missing!'); + $this->assertFileExists($fileName); $this->assertEquals($content, file_get_contents($fileName), 'Incorrect file content!'); } } @@ -189,7 +189,7 @@ class FileHelperTest extends TestCase FileHelper::removeDirectory($dirName); - $this->assertFalse(file_exists($dirName), 'Unable to remove directory!'); + $this->assertFileNotExists($dirName, 'Unable to remove directory!'); // should be silent about non-existing directories FileHelper::removeDirectory($basePath . DIRECTORY_SEPARATOR . 'nonExisting'); @@ -277,7 +277,7 @@ class FileHelperTest extends TestCase $basePath = $this->testFilePath; $dirName = $basePath . DIRECTORY_SEPARATOR . 'test_dir_level_1' . DIRECTORY_SEPARATOR . 'test_dir_level_2'; $this->assertTrue(FileHelper::createDirectory($dirName), 'FileHelper::createDirectory should return true if directory was created!'); - $this->assertTrue(file_exists($dirName), 'Unable to create directory recursively!'); + $this->assertFileExists($dirName, 'Unable to create directory recursively!'); $this->assertTrue(FileHelper::createDirectory($dirName), 'FileHelper::createDirectory should return true for already existing directories!'); }