From 7700d88d4ae375e6c4f3d94f691f88f9d142c0ad Mon Sep 17 00:00:00 2001 From: Robbie Averill Date: Tue, 10 Oct 2017 09:26:17 +1300 Subject: [PATCH] FIX Remove base path assertions from tests which behave differently using phpdbg --- tests/CommentsExtensionTest.php | 8 +++----- tests/CommentsTest.php | 10 +++++----- 2 files changed, 8 insertions(+), 10 deletions(-) diff --git a/tests/CommentsExtensionTest.php b/tests/CommentsExtensionTest.php index cf94259..27ba283 100644 --- a/tests/CommentsExtensionTest.php +++ b/tests/CommentsExtensionTest.php @@ -258,9 +258,7 @@ class CommentsExtensionTest extends SapphireTest // The comments form is HTML to do assertions by contains $cf = $item->CommentsForm(); - $expected = '
'; + $expected = '/comments/CommentsForm/" method="post" enctype="application/x-www-form-urlencoded">'; $this->assertContains($expected, $cf); $this->assertContains('

Post your comment

', $cf); @@ -283,13 +281,13 @@ class CommentsExtensionTest extends SapphireTest $expected = 'assertContains($expected, $cf); - $expected = 'assertContains($expected, $cf); $expected = '

Reply to firstComA 2

'; diff --git a/tests/CommentsTest.php b/tests/CommentsTest.php index 3245407..9649b4b 100644 --- a/tests/CommentsTest.php +++ b/tests/CommentsTest.php @@ -819,30 +819,30 @@ class CommentsTest extends FunctionalTest $method = $this->getMethod('ActionLink'); // test with starts of strings and tokens and salts change each time - $this->assertStringStartsWith( + $this->assertContains( '/comments/theaction/' . $comment->ID, $method->invokeArgs($comment, array('theaction')) ); - $this->assertStringStartsWith( + $this->assertContains( '/comments/delete/' . $comment->ID, $comment->DeleteLink() ); - $this->assertStringStartsWith( + $this->assertContains( '/comments/spam/' . $comment->ID, $comment->SpamLink() ); $comment->markSpam(); - $this->assertStringStartsWith( + $this->assertContains( '/comments/ham/' . $comment->ID, $comment->HamLink() ); //markApproved $comment->markUnapproved(); - $this->assertStringStartsWith( + $this->assertContains( '/comments/approve/' . $comment->ID, $comment->ApproveLink() );