/** * @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); }
/** * Asserts that two variables do not have the same type and value. * Used on objects, it asserts that two variables do not reference * the same object. * * @param mixed $expected * @param mixed $actual * @param string $message */ function assertNotSame($expected, $actual, $message = '') { return PHPUnit_Framework_Assert::assertNotSame($expected, $actual, $message); }
/** * Checks whether last response was valid XML. * This is done with libxml_get_last_error function. * * @part xml */ public function seeResponseIsXml() { libxml_use_internal_errors(true); $doc = simplexml_load_string($this->response); $num = ""; $title = ""; if ($doc === false) { $error = libxml_get_last_error(); $num = $error->code; $title = trim($error->message); libxml_clear_errors(); } libxml_use_internal_errors(false); \PHPUnit_Framework_Assert::assertNotSame(false, $doc, "xml decoding error #{$num} with message \"{$title}\", see http://www.xmlsoft.org/html/libxml-xmlerror.html"); }
public function toHaveLength($length) { if ($this->negate) { a::assertNotSame($length, strlen($this->actual)); } else { a::assertSame($length, strlen($this->actual)); } }
public function notSame($expected) { a::assertNotSame($expected, $this->actual, $this->description); }
/** * Expect that two variables do not have the same type and value. * Used on objects, it asserts that two variables do not reference the same object. * * @param mixed $expected * @param string $message * * @return Expect */ public function notToBe($expected, $message = '') { Assert::assertNotSame($expected, $this->value, $message); return $this; }
public function isNotTheSameAs($expected) { Assert::assertNotSame($expected, $this->actual, $this->description); return $this; }