Skip to content

Commit

Permalink
Merge pull request #3 from Codeception/new-assertion-methods
Browse files Browse the repository at this point in the history
Add new assertion methods
  • Loading branch information
Naktibalda committed Apr 18, 2020
2 parents 87c83ca + 80dc8c9 commit f9bfbb4
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 2 deletions.
4 changes: 2 additions & 2 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,8 @@ sudo: false

install:
- '[[ -z "$CI_USER_TOKEN" ]] || composer config github-oauth.github.com ${CI_USER_TOKEN};'
- travis_retry composer self-update && composer --version
- travis_retry composer update --prefer-dist --no-interaction
- COMPOSER_MEMORY_LIMIT=-1 composer self-update && composer --version
- COMPOSER_MEMORY_LIMIT=-1 composer update --prefer-dist --no-interaction
- php ./vendor/bin/codecept build

script:
Expand Down
3 changes: 3 additions & 0 deletions src/Codeception/Module/Asserts.php
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,8 @@ class Asserts extends CodeceptionModule
assertNotContains as public;
assertRegExp as public;
assertNotRegExp as public;
assertMatchesRegularExpression as public;
assertDoesNotMatchRegularExpression as public;
assertEmpty as public;
assertNotEmpty as public;
assertNull as public;
Expand All @@ -37,6 +39,7 @@ class Asserts extends CodeceptionModule
assertFalse as public;
assertFileExists as public;
assertFileNotExists as public;
assertFileDoesNotExist as public;
assertGreaterOrEquals as public;
assertLessOrEquals as public;
assertIsEmpty as public;
Expand Down
3 changes: 3 additions & 0 deletions tests/unit/Codeception/Module/AssertsTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,8 @@ public function testAsserts()
$this->module->assertNotSame(1, '1');
$this->module->assertRegExp('/^[\d]$/', '1');
$this->module->assertNotRegExp('/^[a-z]$/', '1');
$this->module->assertMatchesRegularExpression('/^[\d]$/', '1');
$this->module->assertDoesNotMatchRegularExpression('/^[a-z]$/', '1');
$this->module->assertStringStartsWith('fo', 'foo');
$this->module->assertStringStartsNotWith('ba', 'foo');
$this->module->assertStringEndsWith('oo', 'foo');
Expand All @@ -43,6 +45,7 @@ public function testAsserts()
$this->module->assertNotFalse('foo');
$this->module->assertFileExists(__FILE__);
$this->module->assertFileNotExists(__FILE__ . '.notExist');
$this->module->assertFileDoesNotExist(__FILE__ . '.notExist');
$this->module->assertInstanceOf('Exception', new Exception());
//assertInternalType is deprecated and will be removed in PHPUnit 9
//$this->module->assertInternalType('integer', 5);
Expand Down

0 comments on commit f9bfbb4

Please sign in to comment.