Skip to content

Commit f9bfbb4

Browse files
authored
Merge pull request #3 from Codeception/new-assertion-methods
Add new assertion methods
2 parents 87c83ca + 80dc8c9 commit f9bfbb4

File tree

3 files changed

+8
-2
lines changed

3 files changed

+8
-2
lines changed

.travis.yml

+2-2
Original file line numberDiff line numberDiff line change
@@ -12,8 +12,8 @@ sudo: false
1212

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

1919
script:

src/Codeception/Module/Asserts.php

+3
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,8 @@ class Asserts extends CodeceptionModule
2929
assertNotContains as public;
3030
assertRegExp as public;
3131
assertNotRegExp as public;
32+
assertMatchesRegularExpression as public;
33+
assertDoesNotMatchRegularExpression as public;
3234
assertEmpty as public;
3335
assertNotEmpty as public;
3436
assertNull as public;
@@ -37,6 +39,7 @@ class Asserts extends CodeceptionModule
3739
assertFalse as public;
3840
assertFileExists as public;
3941
assertFileNotExists as public;
42+
assertFileDoesNotExist as public;
4043
assertGreaterOrEquals as public;
4144
assertLessOrEquals as public;
4245
assertIsEmpty as public;

tests/unit/Codeception/Module/AssertsTest.php

+3
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,8 @@ public function testAsserts()
2323
$this->module->assertNotSame(1, '1');
2424
$this->module->assertRegExp('/^[\d]$/', '1');
2525
$this->module->assertNotRegExp('/^[a-z]$/', '1');
26+
$this->module->assertMatchesRegularExpression('/^[\d]$/', '1');
27+
$this->module->assertDoesNotMatchRegularExpression('/^[a-z]$/', '1');
2628
$this->module->assertStringStartsWith('fo', 'foo');
2729
$this->module->assertStringStartsNotWith('ba', 'foo');
2830
$this->module->assertStringEndsWith('oo', 'foo');
@@ -43,6 +45,7 @@ public function testAsserts()
4345
$this->module->assertNotFalse('foo');
4446
$this->module->assertFileExists(__FILE__);
4547
$this->module->assertFileNotExists(__FILE__ . '.notExist');
48+
$this->module->assertFileDoesNotExist(__FILE__ . '.notExist');
4649
$this->module->assertInstanceOf('Exception', new Exception());
4750
//assertInternalType is deprecated and will be removed in PHPUnit 9
4851
//$this->module->assertInternalType('integer', 5);

0 commit comments

Comments
 (0)