Skip to content

Commit

Permalink
Merge pull request #65 from Codeception/6.0-assertEquals
Browse files Browse the repository at this point in the history
Add specialized assertEquals methods to 6.0 branch
  • Loading branch information
Naktibalda authored Aug 18, 2019
2 parents 8d884fd + f51ee4b commit 4394f87
Show file tree
Hide file tree
Showing 2 changed files with 33 additions and 1 deletion.
4 changes: 3 additions & 1 deletion .travis.yml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
language: php

env:
CODECEPTION_VERSION: '2.6.x-dev'
CODECEPTION_VERSION: 'dev-feature/specialized-assert-equals'

php:
- 5.6
Expand All @@ -16,9 +16,11 @@ script:
- php robo.phar test cli
- php robo.phar test "unit -g core"
- php robo.phar test "tests/unit/Codeception/Constraints/"
- php robo.phar test "tests/unit/Codeception/Module/AssertsTest.php"
# run tests with 2.5 branch
- CODECEPTION_VERSION=2.5.x-dev php robo.phar prepare
- composer update
- php robo.phar test cli
- php robo.phar test "unit -g core"
- php robo.phar test "tests/unit/Codeception/Constraints/"
- php robo.phar test "tests/unit/Codeception/Module/AssertsTest.php"
30 changes: 30 additions & 0 deletions src/TestCase.php
Original file line number Diff line number Diff line change
Expand Up @@ -186,4 +186,34 @@ public static function assertIsNotIterable($actual, $message = '')
{
\Codeception\PHPUnit\TestCase::assertNotInternalType('iterable', $actual, $message);
}

public static function assertEqualsCanonicalizing($expected, $actual, $message = '')
{
\Codeception\PHPUnit\TestCase::assertEquals($expected, $actual, $message, 0.0, 10, true, false);
}

public static function assertNotEqualsCanonicalizing($expected, $actual, $message = '')
{
\Codeception\PHPUnit\TestCase::assertNotEquals($expected, $actual, $message, 0.0, 10, true, false);
}

public static function assertEqualsIgnoringCase($expected, $actual, $message = '')
{
\Codeception\PHPUnit\TestCase::assertEquals($expected, $actual, $message, 0.0, 10, false, true);
}

public static function assertNotEqualsIgnoringCase($expected, $actual, $message = '')
{
\Codeception\PHPUnit\TestCase::assertNotEquals($expected, $actual, $message, 0.0, 10, false, true);
}

public static function assertEqualsWithDelta($expected, $actual, $delta, $message = '')
{
\Codeception\PHPUnit\TestCase::assertEquals($expected, $actual, $message, $delta, 10, false, false);
}

public static function assertNotEqualsWithDelta($expected, $actual, $delta, $message = '')
{
\Codeception\PHPUnit\TestCase::assertNotEquals($expected, $actual, $message, $delta, 10, false, false);
}
}

0 comments on commit 4394f87

Please sign in to comment.