Skip to content

Commit 7f81451

Browse files
committed
test: fix dynamic properties
1 parent 906eade commit 7f81451

File tree

5 files changed

+11
-11
lines changed

5 files changed

+11
-11
lines changed

tests/system/Filters/FiltersTest.php

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -499,7 +499,7 @@ public function testRunDoesBefore()
499499
$uri = 'admin/foo/bar';
500500
$request = $filters->run($uri, 'before');
501501

502-
$this->assertSame('http://google.com', $request->url);
502+
$this->assertSame('http://google.com', $request->getBody());
503503
}
504504

505505
public function testRunDoesAfter()
@@ -519,7 +519,7 @@ public function testRunDoesAfter()
519519
$uri = 'admin/foo/bar';
520520
$response = $filters->run($uri, 'after');
521521

522-
$this->assertSame('http://google.com', $response->csp);
522+
$this->assertSame('http://google.com', $response->getBody());
523523
}
524524

525525
public function testShortCircuit()
@@ -540,7 +540,7 @@ public function testShortCircuit()
540540
$response = $filters->run($uri, 'before');
541541

542542
$this->assertInstanceOf(ResponseInterface::class, $response);
543-
$this->assertSame('http://google.com', $response->csp);
543+
$this->assertSame('http://google.com', $response->getBody());
544544
}
545545

546546
public function testOtherResult()
@@ -1103,8 +1103,8 @@ public function testFilterAliasMultiple()
11031103
$uri = 'admin/foo/bar';
11041104
$request = $filters->run($uri, 'before');
11051105

1106-
$this->assertSame('http://exampleMultipleURL.com', $request->url);
1107-
$this->assertSame('http://exampleMultipleCSP.com', $request->csp);
1106+
$this->assertSame('http://exampleMultipleURL.com', $request->header('x-url')->getValue());
1107+
$this->assertSame('http://exampleMultipleCSP.com', $request->header('x-csp')->getValue());
11081108
}
11091109

11101110
public function testFilterClass()

tests/system/Filters/fixtures/GoogleMe.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -19,14 +19,14 @@ class GoogleMe implements FilterInterface
1919
{
2020
public function before(RequestInterface $request, $arguments = null)
2121
{
22-
$request->url = 'http://google.com';
22+
$request->setBody('http://google.com');
2323

2424
return $request;
2525
}
2626

2727
public function after(RequestInterface $request, ResponseInterface $response, $arguments = null)
2828
{
29-
$response->csp = 'http://google.com';
29+
$response->setBody('http://google.com');
3030

3131
return $response;
3232
}

tests/system/Filters/fixtures/GoogleYou.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -20,8 +20,8 @@ class GoogleYou implements FilterInterface
2020
{
2121
public function before(RequestInterface $request, $arguments = null)
2222
{
23-
$response = Services::response();
24-
$response->csp = 'http://google.com';
23+
$response = Services::response();
24+
$response->setBody('http://google.com');
2525

2626
return $response;
2727
}

tests/system/Filters/fixtures/Multiple1.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ class Multiple1 implements FilterInterface
1919
{
2020
public function before(RequestInterface $request, $arguments = null)
2121
{
22-
$request->csp = 'http://exampleMultipleCSP.com';
22+
$request->setHeader('x-csp', 'http://exampleMultipleCSP.com');
2323

2424
return $request;
2525
}

tests/system/Filters/fixtures/Multiple2.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ class Multiple2 implements FilterInterface
1919
{
2020
public function before(RequestInterface $request, $arguments = null)
2121
{
22-
$request->url = 'http://exampleMultipleURL.com';
22+
$request->setHeader('x-url', 'http://exampleMultipleURL.com');
2323

2424
return $request;
2525
}

0 commit comments

Comments
 (0)