-
-
Notifications
You must be signed in to change notification settings - Fork 1.3k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[Filesystem] dontSeeFileFound searches in path (#3882)
* Updated FTP and SFTP tests Didn't run them * [Filesystem] Created tests for (dont)SeeFileFound To verify #3877 * [Filesystem] dontSeeFileFound searches in path Fixes #3877 * [Filesystem] Set parameter types in docblocks * Reduced code duplication
- Loading branch information
1 parent
8e55204
commit 2aeb8cd
Showing
6 changed files
with
162 additions
and
40 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,90 @@ | ||
<?php | ||
|
||
use Codeception\Module\Filesystem; | ||
use Codeception\Util\Stub; | ||
|
||
class FilesystemTest extends \PHPUnit_Framework_TestCase | ||
{ | ||
|
||
/** | ||
* @var \Codeception\Module\Filesystem | ||
*/ | ||
protected $module; | ||
|
||
public function setUp() | ||
{ | ||
$this->module = new Filesystem(make_container()); | ||
$this->module->_before(Stub::makeEmpty('\Codeception\Test\Test')); | ||
} | ||
|
||
|
||
public function tearDown() | ||
{ | ||
$this->module->_after(Stub::makeEmpty('\Codeception\Test\Test')); | ||
} | ||
|
||
public function testSeeFileFoundPassesWhenFileExists() | ||
{ | ||
$this->module->seeFileFound('tests/data/dumps/mysql.sql'); | ||
} | ||
|
||
public function testSeeFileFoundPassesWhenFileExistsInSubdirectoryOfPath() | ||
{ | ||
$this->module->seeFileFound('mysql.sql', 'tests/data/'); | ||
} | ||
|
||
/** | ||
* @expectedException PHPUnit_Framework_AssertionFailedError | ||
* @expectedExceptionMessage File "does-not-exist" not found at | ||
*/ | ||
public function testSeeFileFoundFailsWhenFileDoesNotExist() | ||
{ | ||
$this->module->seeFileFound('does-not-exist'); | ||
} | ||
|
||
/** | ||
* @expectedException PHPUnit_Framework_AssertionFailedError | ||
* @expectedExceptionMessageRegExp /Directory does not exist: .*does-not-exist/ | ||
*/ | ||
public function testSeeFileFoundFailsWhenPathDoesNotExist() | ||
{ | ||
$this->module->seeFileFound('mysql.sql', 'does-not-exist'); | ||
} | ||
|
||
public function testDontSeeFileFoundPassesWhenFileDoesNotExists() | ||
{ | ||
$this->module->dontSeeFileFound('does-not-exist'); | ||
} | ||
|
||
public function testDontSeeFileFoundPassesWhenFileDoesNotExistsInPath() | ||
{ | ||
$this->module->dontSeeFileFound('does-not-exist', 'tests/data/'); | ||
} | ||
|
||
/** | ||
* @expectedException PHPUnit_Framework_AssertionFailedError | ||
* @expectedExceptionMessage Failed asserting that file "tests/data/dumps/mysql.sql" does not exist. | ||
*/ | ||
public function testDontSeeFileFoundFailsWhenFileExists() | ||
{ | ||
$this->module->dontSeeFileFound('tests/data/dumps/mysql.sql'); | ||
} | ||
|
||
/** | ||
* @expectedException PHPUnit_Framework_AssertionFailedError | ||
* @expectedExceptionMessageRegExp /Directory does not exist: .*does-not-exist/ | ||
*/ | ||
public function testDontSeeFileFoundFailsWhenPathDoesNotExist() | ||
{ | ||
$this->module->dontSeeFileFound('mysql.sql', 'does-not-exist'); | ||
} | ||
|
||
/** | ||
* @expectedException PHPUnit_Framework_AssertionFailedError | ||
* @expectedExceptionMessageRegExp /Failed asserting that file ".*tests\/data\/dumps\/mysql.sql" does not exist/ | ||
*/ | ||
public function testDontSeeFileFoundFailsWhenFileExistsInSubdirectoryOfPath() | ||
{ | ||
$this->module->dontSeeFileFound('mysql.sql', 'tests/data/'); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters