assertEquals(false, LinkHelper::checkIfAlreadyShortened($u)); } foreach ($shortened as $u) { $this->assertEquals(true, LinkHelper::checkIfAlreadyShortened($u)); } } public function testLinkExists() { $link = LinkFactory::createLink('http://example.com/ci', true, null, '127.0.0.1', false, true); // assert that existent link ending returns true $this->assertNotEquals(LinkHelper::linkExists($link->short_url), false); // assert that nonexistent link ending returns false $this->assertEquals(LinkHelper::linkExists('nonexistent'), false); } }