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:
parent
d52b634913
commit
62f5870611
@ -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;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -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);
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user