Skip to content

Commit 062940d

Browse files
committed
Add new assertion methods:
* assertMatchesRegularExpression * assertDoesNotMatchRegularExpression * assertFileDoesNotExist
1 parent 87c83ca commit 062940d

File tree

2 files changed

+6
-0
lines changed

2 files changed

+6
-0
lines changed

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)