Skip to content

Commit

Permalink
Fix dependent tests
Browse files Browse the repository at this point in the history
  • Loading branch information
MGatner committed May 13, 2021
1 parent 1034e69 commit 5fd639e
Show file tree
Hide file tree
Showing 4 changed files with 12 additions and 9 deletions.
6 changes: 3 additions & 3 deletions tests/system/HTTP/ResponseTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -176,23 +176,23 @@ public function testSetLink()
$response->setLink($pager);

$this->assertEquals(
'<http://example.com/test/?page=1>; rel="first",<http://example.com/test/?page=2>; rel="prev",<http://example.com/test/?page=4>; rel="next",<http://example.com/test/?page=20>; rel="last"',
'<http://example.com/test/index.php?page=1>; rel="first",<http://example.com/test/index.php?page=2>; rel="prev",<http://example.com/test/index.php?page=4>; rel="next",<http://example.com/test/index.php?page=20>; rel="last"',
$response->header('Link')->getValue()
);

$pager->store('default', 1, 10, 200);
$response->setLink($pager);

$this->assertEquals(
'<http://example.com/test/?page=2>; rel="next",<http://example.com/test/?page=20>; rel="last"',
'<http://example.com/test/index.php?page=2>; rel="next",<http://example.com/test/index.php?page=20>; rel="last"',
$response->header('Link')->getValue()
);

$pager->store('default', 20, 10, 200);
$response->setLink($pager);

$this->assertEquals(
'<http://example.com/test/?page=1>; rel="first",<http://example.com/test/?page=19>; rel="prev"',
'<http://example.com/test/index.php?page=1>; rel="first",<http://example.com/test/index.php?page=19>; rel="prev"',
$response->header('Link')->getValue()
);
}
Expand Down
3 changes: 3 additions & 0 deletions tests/system/HTTP/URITest.php
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,9 @@
use CodeIgniter\Test\CIUnitTestCase;
use Config\App;

/**
* @backupGlobals enabled
*/
class URITest extends CIUnitTestCase
{

Expand Down
4 changes: 2 additions & 2 deletions tests/system/Helpers/FormHelperTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -96,15 +96,15 @@ public function testFormOpenWithoutAction()
$Value = csrf_hash();
$Name = csrf_token();
$expected = <<<EOH
<form action="http://example.com/" name="form" id="form" method="POST" accept-charset="utf-8">
<form action="http://example.com/index.php" name="form" id="form" method="POST" accept-charset="utf-8">
<input type="hidden" name="$Name" value="$Value" style="display:none;" />
EOH;
}
else
{
$expected = <<<EOH
<form action="http://example.com/" name="form" id="form" method="POST" accept-charset="utf-8">
<form action="http://example.com/index.php" name="form" id="form" method="POST" accept-charset="utf-8">
EOH;
}
Expand Down
8 changes: 4 additions & 4 deletions tests/system/Pager/PagerTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -133,11 +133,11 @@ public function testStoreWithQueries()

$this->pager->store('default', 3, 25, 100);

$this->assertEquals('http://example.com?page=2&foo=bar', $this->pager->getPreviousPageURI());
$this->assertEquals('http://example.com?page=4&foo=bar', $this->pager->getNextPageURI());
$this->assertEquals('http://example.com?page=5&foo=bar', $this->pager->getPageURI(5));
$this->assertEquals('http://example.com/index.php?page=2&foo=bar', $this->pager->getPreviousPageURI());
$this->assertEquals('http://example.com/index.php?page=4&foo=bar', $this->pager->getNextPageURI());
$this->assertEquals('http://example.com/index.php?page=5&foo=bar', $this->pager->getPageURI(5));
$this->assertEquals(
'http://example.com?foo=bar&page=5',
'http://example.com/index.php?foo=bar&page=5',
$this->pager->only(['foo'])->getPageURI(5)
);
}
Expand Down

0 comments on commit 5fd639e

Please sign in to comment.