Пример #1
0
 /**
  * @test
  * @group metadata
  * @group common
  */
 public function equality_is_verified_on_all_properties()
 {
     $base = new Endpoint(Binding::httpPost(), 'some:uri', 'some:response:location');
     $same = new Endpoint(Binding::httpPost(), 'some:uri', 'some:response:location');
     $noResponseLocation = new Endpoint(Binding::httpPost(), 'some:uri');
     $differentBinding = new Endpoint(Binding::httpRedirect(), 'some:uri', 'some:response:location');
     $differentLocation = new Endpoint(Binding::httpRedirect(), 'some:different:uri', 'some:response:location');
     $differentResponseLocation = new Endpoint(Binding::httpRedirect(), 'some:different:uri', 'different:esponse:location');
     $this->assertTrue($base->equals($same));
     $this->assertFalse($base->equals($noResponseLocation));
     $this->assertFalse($base->equals($differentBinding));
     $this->assertFalse($base->equals($differentLocation));
     $this->assertFalse($base->equals($differentResponseLocation));
 }
Пример #2
0
 /**
  * @test
  * @group metadata
  * @group common
  */
 public function bindings_are_equal_if_they_are_of_the_same_type()
 {
     $base = Binding::httpPost();
     $same = Binding::httpPost();
     $different = Binding::httpRedirect();
     $this->assertTrue($base->equals($same));
     $this->assertFalse($base->equals($different));
 }
 /**
  * @test
  * @group metadata
  * @group common
  */
 public function equality_is_verified_on_endpoint_index_and_is_default()
 {
     $base = new IndexedEndpoint($this->getPostEndpoint(), 1);
     $same = new IndexedEndpoint($this->getPostEndpoint(), 1);
     $differentEndpoint = new IndexedEndpoint(new Endpoint(Binding::httpRedirect(), 'some:uri'), 1);
     $differentIndex = new IndexedEndpoint($this->getPostEndpoint(), 9);
     $differentDefault = new IndexedEndpoint($this->getPostEndpoint(), 1, true);
     $this->assertTrue($base->equals($same));
     $this->assertFalse($base->equals($differentEndpoint));
     $this->assertFalse($base->equals($differentIndex));
     $this->assertFalse($base->equals($differentDefault));
 }