Skip to content
This repository has been archived by the owner on Jan 24, 2023. It is now read-only.

Commit

Permalink
Added assertNotSame to phpunit
Browse files Browse the repository at this point in the history
  • Loading branch information
jarredwsimmer committed Feb 6, 2019
1 parent 229371f commit 3676a17
Show file tree
Hide file tree
Showing 2 changed files with 21 additions and 0 deletions.
17 changes: 17 additions & 0 deletions src/Zynga/Framework/Testing/TestCase/V2/Base.hh
Original file line number Diff line number Diff line change
Expand Up @@ -571,6 +571,23 @@ abstract class Base
$this->_testCaseShim->assertSame($expected, $actual, $message);
}

/**
* Asserts that two variables have either a different type or value.
* Used on objects, it asserts that two variables reference
* different objects.
*
* @param mixed $expected
* @param mixed $actual
* @param string $message
*/
public function assertNotSame(
mixed $expected,
mixed $actual,
string $message = '',
): void {
$this->_testCaseShim->assertNotSame($expected, $actual, $message);
}

/**
* Asserts that a file exists.
*
Expand Down
4 changes: 4 additions & 0 deletions src/Zynga/Framework/Testing/TestCase/V2/BaseTest.hh
Original file line number Diff line number Diff line change
Expand Up @@ -98,6 +98,10 @@ class BaseTest extends ZyngaTestCase {

}

public function testAssertNotSameReturnsTrueOnDifferentValues(): void {
$this->assertNotSame(1, 2);
}

/**
* testInvalidAssertClassImplements
*/
Expand Down

0 comments on commit 3676a17

Please sign in to comment.