Exemplo n.º 1
0
 /**
  * @depends testSerializationDeserialization
  * @param WebHook $obj
  */
 public function testGetters($obj)
 {
     $this->assertEquals($obj->getId(), "23beeafe-2f93-4d88-84d9-6cc9acf4d459");
     $this->assertEquals($obj->getEvent(), "unconfirmed-tx");
     $this->assertEquals($obj->getHash(), "2b17f5589528f97436b5d563635b4b27ca8980aa20c300abdc538f2a8bfa871b");
     $this->assertEquals($obj->getWalletName(), "TestWalletName");
     $this->assertEquals($obj->getToken(), "c0afcccdde5081d6429de37d16166ead");
     $this->assertEquals($obj->getAddress(), "TestAddress");
     $this->assertEquals($obj->getScript(), "TestScript");
     $this->assertEquals($obj->getUrl(), "https://requestb.in/slmm49sl?uniqid=5537d0e823f80");
     $this->assertEquals($obj->getCallbackErrors(), 0);
     // NOTICE: filter string does not contains \u0026 present in json string
     $this->assertEquals($obj->getFilter(), "event=unconfirmed-tx&hash=2b17f5589528f97436b5d563635b4b27ca8980aa20c300abdc538f2a8bfa871b");
 }
Exemplo n.º 2
0
 /**
  * Assert two WebHooks are equivalent. It compares only immutable properties.
  * @param WebHook $webHook1
  * @param WebHook $webHook2
  */
 private function assertWebHooksAreEquivalent($webHook1, $webHook2)
 {
     //$this->assertEquals($webHook1->getId(), $webHook2->getId());
     $this->assertEquals($webHook1->getEvent(), $webHook2->getEvent());
     $this->assertEquals($webHook1->getHash(), $webHook2->getHash());
     $this->assertEquals($webHook1->getWalletName(), $webHook2->getWalletName());
     $this->assertEquals($webHook1->getToken(), $webHook2->getToken());
     $this->assertEquals($webHook1->getAddress(), $webHook2->getAddress());
     $this->assertEquals($webHook1->getScript(), $webHook2->getScript());
     $this->assertEquals($webHook1->getUrl(), $webHook2->getUrl());
     //$this->assertEquals($webHook1->getErrors(), $webHook2->getErrors());
     $this->assertEquals($webHook1->getFilter(), $webHook2->getFilter());
 }