FIX Remove base path assertions from tests which behave differently using phpdbg

This commit is contained in:
Robbie Averill 2017-10-10 09:26:17 +13:00
parent fa61608c7d
commit 7700d88d4a
2 changed files with 8 additions and 10 deletions

View File

@ -258,9 +258,7 @@ class CommentsExtensionTest extends SapphireTest
// The comments form is HTML to do assertions by contains
$cf = $item->CommentsForm();
$expected = '<form id="comments-holder" action="/comments'
. '/CommentsForm/" method="post" enctype="application/x-www-form-urlenco'
. 'ded">';
$expected = '/comments/CommentsForm/" method="post" enctype="application/x-www-form-urlencoded">';
$this->assertContains($expected, $cf);
$this->assertContains('<h4>Post your comment</h4>', $cf);
@ -283,13 +281,13 @@ class CommentsExtensionTest extends SapphireTest
$expected = '<input type="submit" name="action_doPostComment" value="Post" class="action" id="comments-holder_action_doPostComment"';
$this->assertContains($expected, $cf);
$expected = '<a href="/comments/spam/';
$expected = '/comments/spam/';
$this->assertContains($expected, $cf);
$expected = '<p>Reply to firstComA 1</p>';
$this->assertContains($expected, $cf);
$expected = '<a href="/comments/delete';
$expected = '/comments/delete';
$this->assertContains($expected, $cf);
$expected = '<p>Reply to firstComA 2</p>';

View File

@ -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()
);