/** * @test * @codeCoverageIgnore */ public function createWebhookWithUrl() { $this->_model->setUrl('http://example.com/dummyCallback')->setActive(true)->setEventTypes(array('transaction.succeeded', 'subscription.created')); $result = $this->_service->create($this->_model); $this->assertInstanceOf('Paymill\\Models\\Response\\Webhook', $result, var_export($result, true)); $this->assertTrue($result->getActive()); return $result; }
/** * Tests the getters and setters of the model * @test */ public function setGetTest() { $sample = array('url' => 'your-webhook-url', 'email' => 'your-webhook-email', 'event_types' => array('transaction.succeeded', 'subscription.created'), 'state' => true); $this->_webhook->setUrl($sample['url'])->setEmail($sample['email'])->setEventTypes($sample['event_types'])->setActive($sample['state']); $this->assertEquals($this->_webhook->getUrl(), $sample['url']); $this->assertEquals($this->_webhook->getEmail(), $sample['email']); $this->assertEquals($this->_webhook->getEventTypes(), $sample['event_types']); $this->assertEquals($this->_webhook->getActive(), $sample['state']); return $this->_webhook; }