PHPUnit_Framework_Assert::assertNotSame PHP Method

assertNotSame() public static method

Used on objects, it asserts that two variables do not reference the same object.
public static assertNotSame ( mixed $expected, mixed $actual, string $message = '' )
$expected mixed
$actual mixed
$message string
    public static function assertNotSame($expected, $actual, $message = '')
    {
        if (is_bool($expected) && is_bool($actual)) {
            static::assertNotEquals($expected, $actual, $message);
        } else {
            $constraint = new PHPUnit_Framework_Constraint_Not(new PHPUnit_Framework_Constraint_IsIdentical($expected));
            static::assertThat($actual, $constraint, $message);
        }
    }

Usage Example

 /**
  * @test
  */
 public function it_should_change_message_type()
 {
     $messageType = new MessageType(MessageType::PONG);
     $socketMessage = $this->socketMessage->changeMessageType($messageType);
     \PHPUnit_Framework_Assert::assertNotSame($this->socketMessage, $socketMessage);
     $this->assertEquals($socketMessage->getMessageType(), $messageType);
     $this->assertSame($socketMessage->getCredentials(), $this->credentials);
     $this->assertEquals($socketMessage->getCorrelationID(), 'correlation');
     $this->assertSame($socketMessage->getData(), $this->protobufMessage);
 }
All Usage Examples Of PHPUnit_Framework_Assert::assertNotSame
PHPUnit_Framework_Assert