public function testSubscribeAndSendServiceTemporarilyUnavailable() { $this->setExpectedException('Exception'); $client = $this->getMock('\\Yesmail\\CurlClient', array('get_info'), array('', '')); $client->expects($this->any())->method('get_info')->will($this->returnValue(array('http_code' => 503))); $yesmail = new Yesmail($client, self::YESMAIL_TEST_URL); $subscription_state = "SUBSCRIBED"; $division = self::DIVISION; $attributes = array('email' => '*****@*****.**'); $allow_resubscribe = true; $masterId = 123; $yesmail->Subscribe_And_Send($subscription_state, $division, $attributes, $allow_resubscribe, $masterId); }
public function testMasterPostCountError() { $this->setExpectedException('Exception'); $client = $this->getMock('\\Yesmail\\CurlClient', array('get_info'), array('', '')); $client->expects($this->any())->method('get_info')->will($this->returnValue(array('http_code' => 403))); $yesmail = new Yesmail($client, self::YESMAIL_TEST_URL); $masterId = 123; $yesmail->Master_Post_Run_Count($masterId); }