From 5384291845e74fd7d54f3d925c4a86ce12336593 Mon Sep 17 00:00:00 2001 From: Christian Flothmann Date: Sun, 2 Mar 2025 16:03:52 +0100 Subject: [PATCH] replace assertEmpty() with stricter assertions --- Tests/AbstractBrowserTest.php | 6 +++--- Tests/CookieJarTest.php | 2 +- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/Tests/AbstractBrowserTest.php b/Tests/AbstractBrowserTest.php index 7e759b0..dd7f8e4 100644 --- a/Tests/AbstractBrowserTest.php +++ b/Tests/AbstractBrowserTest.php @@ -642,10 +642,10 @@ public function testFollowRedirectDropPostMethod() $client->request('POST', 'http://www.example.com/foo/foobar', $parameters, $files, $server, $content); $this->assertSame('http://www.example.com/redirected', $client->getRequest()->getUri(), '->followRedirect() follows a redirect with POST method on response code: '.$code.'.'); - $this->assertEmpty($client->getRequest()->getParameters(), '->followRedirect() drops parameters with POST method on response code: '.$code.'.'); - $this->assertEmpty($client->getRequest()->getFiles(), '->followRedirect() drops files with POST method on response code: '.$code.'.'); + $this->assertSame([], $client->getRequest()->getParameters(), '->followRedirect() drops parameters with POST method on response code: '.$code.'.'); + $this->assertSame([], $client->getRequest()->getFiles(), '->followRedirect() drops files with POST method on response code: '.$code.'.'); $this->assertArrayHasKey('X_TEST_FOO', $client->getRequest()->getServer(), '->followRedirect() keeps $_SERVER with POST method on response code: '.$code.'.'); - $this->assertEmpty($client->getRequest()->getContent(), '->followRedirect() drops content with POST method on response code: '.$code.'.'); + $this->assertNull($client->getRequest()->getContent(), '->followRedirect() drops content with POST method on response code: '.$code.'.'); $this->assertSame('GET', $client->getRequest()->getMethod(), '->followRedirect() drops request method to GET on response code: '.$code.'.'); } } diff --git a/Tests/CookieJarTest.php b/Tests/CookieJarTest.php index 2f0ebaf..2e456b8 100644 --- a/Tests/CookieJarTest.php +++ b/Tests/CookieJarTest.php @@ -247,6 +247,6 @@ public function testCookieWithWildcardDomain() $cookieJar->set(new Cookie('foo', 'bar', null, '/', '.example.com')); $this->assertEquals(['foo' => 'bar'], $cookieJar->allValues('http://www.example.com')); - $this->assertEmpty($cookieJar->allValues('http://wwwexample.com')); + $this->assertSame([], $cookieJar->allValues('http://wwwexample.com')); } }