Skip to content

Commit 5fd639e

Browse files
committed
Fix dependent tests
1 parent 1034e69 commit 5fd639e

4 files changed

Lines changed: 12 additions & 9 deletions

File tree

tests/system/HTTP/ResponseTest.php

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -176,23 +176,23 @@ public function testSetLink()
176176
$response->setLink($pager);
177177

178178
$this->assertEquals(
179-
'<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"',
179+
'<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"',
180180
$response->header('Link')->getValue()
181181
);
182182

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

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

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

194194
$this->assertEquals(
195-
'<http://example.com/test/?page=1>; rel="first",<http://example.com/test/?page=19>; rel="prev"',
195+
'<http://example.com/test/index.php?page=1>; rel="first",<http://example.com/test/index.php?page=19>; rel="prev"',
196196
$response->header('Link')->getValue()
197197
);
198198
}

tests/system/HTTP/URITest.php

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,9 @@
88
use CodeIgniter\Test\CIUnitTestCase;
99
use Config\App;
1010

11+
/**
12+
* @backupGlobals enabled
13+
*/
1114
class URITest extends CIUnitTestCase
1215
{
1316

tests/system/Helpers/FormHelperTest.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -96,15 +96,15 @@ public function testFormOpenWithoutAction()
9696
$Value = csrf_hash();
9797
$Name = csrf_token();
9898
$expected = <<<EOH
99-
<form action="http://example.com/" name="form" id="form" method="POST" accept-charset="utf-8">
99+
<form action="http://example.com/index.php" name="form" id="form" method="POST" accept-charset="utf-8">
100100
<input type="hidden" name="$Name" value="$Value" style="display:none;" />
101101
102102
EOH;
103103
}
104104
else
105105
{
106106
$expected = <<<EOH
107-
<form action="http://example.com/" name="form" id="form" method="POST" accept-charset="utf-8">
107+
<form action="http://example.com/index.php" name="form" id="form" method="POST" accept-charset="utf-8">
108108
109109
EOH;
110110
}

tests/system/Pager/PagerTest.php

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -133,11 +133,11 @@ public function testStoreWithQueries()
133133

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

136-
$this->assertEquals('http://example.com?page=2&foo=bar', $this->pager->getPreviousPageURI());
137-
$this->assertEquals('http://example.com?page=4&foo=bar', $this->pager->getNextPageURI());
138-
$this->assertEquals('http://example.com?page=5&foo=bar', $this->pager->getPageURI(5));
136+
$this->assertEquals('http://example.com/index.php?page=2&foo=bar', $this->pager->getPreviousPageURI());
137+
$this->assertEquals('http://example.com/index.php?page=4&foo=bar', $this->pager->getNextPageURI());
138+
$this->assertEquals('http://example.com/index.php?page=5&foo=bar', $this->pager->getPageURI(5));
139139
$this->assertEquals(
140-
'http://example.com?foo=bar&page=5',
140+
'http://example.com/index.php?foo=bar&page=5',
141141
$this->pager->only(['foo'])->getPageURI(5)
142142
);
143143
}

0 commit comments

Comments
 (0)