From 62f58706115a5cd465aef08e41de82a7f8771dd8 Mon Sep 17 00:00:00 2001 From: Chaoyi Zha Date: Sun, 14 Feb 2016 02:27:06 -0500 Subject: [PATCH] Fix LinkHelperTest to create new links on each test --- app/Factories/LinkFactory.php | 2 +- tests/LinkHelperTest.php | 5 ++--- 2 files changed, 3 insertions(+), 4 deletions(-) diff --git a/app/Factories/LinkFactory.php b/app/Factories/LinkFactory.php index 52cbb56..3a1edc5 100644 --- a/app/Factories/LinkFactory.php +++ b/app/Factories/LinkFactory.php @@ -20,7 +20,7 @@ class LinkFactory { if ($secret_ending) { $short_url .= '/' . $secret_ending; } - + return 'aaa'; return $short_url; } diff --git a/tests/LinkHelperTest.php b/tests/LinkHelperTest.php index 9d0153e..12fcab6 100644 --- a/tests/LinkHelperTest.php +++ b/tests/LinkHelperTest.php @@ -36,11 +36,10 @@ class LinkHelperTest extends TestCase } 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 - $this->assertEquals(LinkHelper::linkExists($link->short_url), true); + $this->assertNotEquals(LinkHelper::linkExists($link->short_url), false); // assert that nonexistent link ending returns false $this->assertEquals(LinkHelper::linkExists('nonexistent'), false); - } }