1
0
mirror of https://github.com/cydrobolt/polr.git synced 2024-11-09 11:42:28 +01:00

Fix LinkHelperTest to create new links on each test

This commit is contained in:
Chaoyi Zha 2016-02-14 02:27:06 -05:00
parent d52b634913
commit 62f5870611
2 changed files with 3 additions and 4 deletions

View File

@ -20,7 +20,7 @@ class LinkFactory {
if ($secret_ending) { if ($secret_ending) {
$short_url .= '/' . $secret_ending; $short_url .= '/' . $secret_ending;
} }
return 'aaa';
return $short_url; return $short_url;
} }

View File

@ -36,11 +36,10 @@ class LinkHelperTest extends TestCase
} }
public function testLinkExists() { public function testLinkExists() {
$link = LinkFactory::createLink('http://example.com/ci', $is_secret=false, $custom_ending=null, $link_ip='127.0.0.1', $creator=false, $return_object=true); $link = LinkFactory::createLink('http://example.com/ci', true, null, '127.0.0.1', false, true);
// assert that existent link ending returns true // assert that existent link ending returns true
$this->assertEquals(LinkHelper::linkExists($link->short_url), true); $this->assertNotEquals(LinkHelper::linkExists($link->short_url), false);
// assert that nonexistent link ending returns false // assert that nonexistent link ending returns false
$this->assertEquals(LinkHelper::linkExists('nonexistent'), false); $this->assertEquals(LinkHelper::linkExists('nonexistent'), false);
} }
} }