diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index 135099c..5d4e738 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -8,7 +8,7 @@ jobs: strategy: matrix: - php: [5.6, 7.0, 7.1, 7.2, 7.3, 7.4] + php: [5.6, 7.0, 7.1, 7.2, 7.3, 7.4, 8.0] steps: - name: Checkout code @@ -24,9 +24,7 @@ jobs: run: composer validate - name: Install dependencies - run: | - composer require phpunit/phpunit "<=8.5.2" --no-update --ignore-platform-reqs - composer install --prefer-dist --no-progress --no-interaction --no-suggest + run: composer install --prefer-dist --no-progress --no-interaction --no-suggest - name: Run test suite run: php vendor/bin/codecept run diff --git a/Robofile.php b/Robofile.php deleted file mode 100644 index 8fbf3ea..0000000 --- a/Robofile.php +++ /dev/null @@ -1,21 +0,0 @@ - 

Module reference is taken from the source code. Help us to improve documentation. Edit module reference
'; - $documentationFile = 'documentation.md'; - $this->generateDocumentationForClass($className, $documentationFile, $sourceMessage); - } -} \ No newline at end of file diff --git a/composer.json b/composer.json index 1a26019..2780f15 100644 --- a/composer.json +++ b/composer.json @@ -15,13 +15,10 @@ ], "minimum-stability": "RC", "require": { - "php": ">=5.6.0 <8.0", + "php": ">=5.6.0 <9.0", "codeception/codeception": "^4.0", "symfony/finder": ">=2.7 <6.0" }, - "require-dev": { - "codeception/util-robohelpers": "dev-master" - }, "conflict": { "codeception/codeception": "<4.0" }, diff --git a/documentation.md b/documentation.md deleted file mode 100644 index 3884af7..0000000 --- a/documentation.md +++ /dev/null @@ -1,199 +0,0 @@ -# Filesystem - - -Module for testing local filesystem. -Fork it to extend the module for FTP, Amazon S3, others. - -## Status - -* Maintainer: **davert** -* Stability: **stable** -* Contact: codecept@davert.mail.ua - -Module was developed to test Codeception itself. - -## Actions - -### amInPath - -Enters a directory In local filesystem. -Project root directory is used by default - - * `param string` $path - - -### cleanDir - -Erases directory contents - -``` php -cleanDir('logs'); -?> -``` - - * `param string` $dirname - - -### copyDir - -Copies directory with all contents - -``` php -copyDir('vendor','old_vendor'); -?> -``` - - * `param string` $src - * `param string` $dst - - -### deleteDir - -Deletes directory with all subdirectories - -``` php -deleteDir('vendor'); -?> -``` - - * `param string` $dirname - - -### deleteFile - -Deletes a file - -``` php -deleteFile('composer.lock'); -?> -``` - - * `param string` $filename - - -### deleteThisFile - -Deletes a file - - -### dontSeeFileFound - -Checks if file does not exist in path - - * `param string` $filename - * `param string` $path - - -### dontSeeInThisFile - -Checks If opened file doesn't contain `text` in it - -``` php -openFile('composer.json'); -$I->dontSeeInThisFile('codeception/codeception'); -?> -``` - - * `param string` $text - - -### openFile - -Opens a file and stores it's content. - -Usage: - -``` php -openFile('composer.json'); -$I->seeInThisFile('codeception/codeception'); -?> -``` - - * `param string` $filename - - -### seeFileContentsEqual - -Checks the strict matching of file contents. -Unlike `seeInThisFile` will fail if file has something more than expected lines. -Better to use with HEREDOC strings. -Matching is done after removing "\r" chars from file content. - -``` php -openFile('process.pid'); -$I->seeFileContentsEqual('3192'); -?> -``` - - * `param string` $text - - -### seeFileFound - -Checks if file exists in path. -Opens a file when it's exists - -``` php -seeFileFound('UserModel.php','app/models'); -?> -``` - - * `param string` $filename - * `param string` $path - - -### seeInThisFile - -Checks If opened file has `text` in it. - -Usage: - -``` php -openFile('composer.json'); -$I->seeInThisFile('codeception/codeception'); -?> -``` - - * `param string` $text - - -### seeNumberNewLines - -Checks If opened file has the `number` of new lines. - -Usage: - -``` php -openFile('composer.json'); -$I->seeNumberNewLines(5); -?> -``` - - * `param int` $number New lines - - -### seeThisFileMatches - -Checks that contents of currently opened file matches $regex - - * `param string` $regex - - -### writeToFile - -Saves contents to file - - * `param string` $filename - * `param string` $contents - -

 

Module reference is taken from the source code. Help us to improve documentation. Edit module reference
diff --git a/readme.md b/readme.md index cc9e8a8..ca0e7db 100644 --- a/readme.md +++ b/readme.md @@ -10,4 +10,4 @@ composer require --dev "codeception/module-filesystem" ## Documentation -Look at documentation.md file +Module documentation diff --git a/src/Codeception/Module/Filesystem.php b/src/Codeception/Module/Filesystem.php index 9d87873..c3c5a14 100644 --- a/src/Codeception/Module/Filesystem.php +++ b/src/Codeception/Module/Filesystem.php @@ -95,7 +95,7 @@ public function openFile($filename) public function deleteFile($filename) { if (!file_exists($this->absolutizePath($filename))) { - \PHPUnit\Framework\Assert::fail('file not found'); + \Codeception\PHPUnit\TestCase::fail('file not found'); } unlink($this->absolutizePath($filename)); } @@ -204,7 +204,7 @@ public function seeThisFileMatches($regex) public function seeFileContentsEqual($text) { $file = str_replace("\r", '', $this->file); - \PHPUnit\Framework\Assert::assertEquals($text, $file); + \Codeception\PHPUnit\TestCase::assertEquals($text, $file); } /** @@ -249,7 +249,7 @@ public function seeFileFound($filename, $path = '') { if ($path === '' && file_exists($filename)) { $this->openFile($filename); - \PHPUnit\Framework\Assert::assertFileExists($filename); + \Codeception\PHPUnit\TestCase::assertFileExists($filename); return; } @@ -260,7 +260,7 @@ public function seeFileFound($filename, $path = '') } $this->openFile($found); - \PHPUnit\Framework\Assert::assertFileExists($found); + \Codeception\PHPUnit\TestCase::assertFileExists($found); } /** @@ -272,7 +272,7 @@ public function seeFileFound($filename, $path = '') public function dontSeeFileFound($filename, $path = '') { if ($path === '') { - \PHPUnit\Framework\Assert::assertFileNotExists($filename); + \Codeception\PHPUnit\TestCase::assertFileNotExists($filename); return; } @@ -280,11 +280,11 @@ public function dontSeeFileFound($filename, $path = '') if ($found === false) { //this line keeps a count of assertions correct - \PHPUnit\Framework\Assert::assertTrue(true); + \Codeception\PHPUnit\TestCase::assertTrue(true); return; } - \PHPUnit\Framework\Assert::assertFileNotExists($found); + \Codeception\PHPUnit\TestCase::assertFileNotExists($found); } /**