public function testGenerateEmailConfirmationLink() { $service = new \Box\Mod\Client\Service(); $service->setDi($this->di); $link = $service->generateEmailConfirmationLink(1); $this->assertInternalType('string', $link); $this->assertEquals(strpos($link, 'http://'), 0); }
public function testgenerateEmailConfirmationLink() { $model = new \Model_ExtensionMeta(); $model->loadBean(new \RedBeanPHP\OODBBean()); $database = $this->getMockBuilder('\\Box_Database')->getMock(); $database->expects($this->atLeastOnce())->method('dispense')->will($this->returnValue($model)); $database->expects($this->atLeastOnce())->method('store')->will($this->returnValue(1)); $toolsMock = $this->getMockBuilder('\\Box_Tools')->getMock(); $toolsMock->expects($this->atLeastOnce())->method('url')->will($this->returnValue('boxbilling.com/index.php/client/confirm-email/')); $di = new \Box_Di(); $di['db'] = $database; $di['tools'] = $toolsMock; $clientService = new \Box\Mod\Client\Service(); $clientService->setDi($di); $client_id = 1; $result = $clientService->generateEmailConfirmationLink($client_id); $this->assertInternalType('string', $result); $this->assertTrue(strpos($result, '/client/confirm-email/') !== false); }