public function testSameValueAs() { $real1 = new Real(0.1); $real2 = new Real(0.1); $real3 = new Real('0.1'); $real4 = new Real(0.2); $this->assertTrue($real1->sameValueAs($real2)); $this->assertTrue($real1->sameValueAs($real3)); $this->assertTrue($real2->sameValueAs($real1)); $this->assertTrue($real2->sameValueAs($real3)); $this->assertTrue($real3->sameValueAs($real1)); $this->assertTrue($real3->sameValueAs($real2)); $this->assertFalse($real2->sameValueAs($real4)); }
public function testSameValueAs() { $real1 = new Real(5.64); $real2 = new Real(5.64); $real3 = new Real(6.01); $this->assertTrue($real1->sameValueAs($real2)); $this->assertTrue($real2->sameValueAs($real1)); $this->assertFalse($real1->sameValueAs($real3)); $mock = $this->getMock('ValueObjects\\ValueObjectInterface'); $this->assertFalse($real1->sameValueAs($mock)); }
public function testGetArgument() { $arg = new Real(1.0010398733119); $this->assertTrue($arg->sameValueAs($this->complex->getArgument())); }