public function testGetters() { $cipher = $this->getFaker()->unique()->word; $keyName = $this->getFaker()->unique()->word; $profile = new Profile($cipher, $keyName); $this->assertEquals($cipher, $profile->getCipher()); $this->assertEquals($keyName, $profile->getKeyName()); $this->assertTrue($profile->equals(new Profile($cipher, $keyName))); $this->assertFalse($profile->equals(new Profile($this->getFaker()->unique()->word, $keyName))); $this->assertFalse($profile->equals(new Profile($cipher, $this->getFaker()->unique()->word))); }
public function equals(self $profile) { return $this->getCipher() == $profile->getCipher() && $this->getKeyName() == $profile->getKeyName(); }