Skip to content

Commit

Permalink
Update UtilsTest.php
Browse files Browse the repository at this point in the history
  • Loading branch information
GrahamCampbell committed Mar 31, 2024
1 parent 1ab9528 commit 96c7505
Showing 1 changed file with 0 additions and 30 deletions.
30 changes: 0 additions & 30 deletions tests/UtilsTest.php
Expand Up @@ -76,31 +76,26 @@ public function testParsesHeadersFromLinesWithMultipleLines()
$expected = ['Foo' => ['bar', 'baz', '123']];

self::assertSame($expected, Utils::headersFromLines($lines));
self::assertSame($expected, GuzzleHttp\headers_from_lines($lines));
}

public function testChooseHandler()
{
self::assertIsCallable(Utils::chooseHandler());
self::assertIsCallable(GuzzleHttp\choose_handler());
}

public function testDefaultUserAgent()
{
self::assertIsString(Utils::defaultUserAgent());
self::assertIsString(GuzzleHttp\default_user_agent());
}

public function testReturnsDebugResource()
{
self::assertIsResource(Utils::debugResource());
self::assertIsResource(GuzzleHttp\debug_resource());
}

public function testProvidesDefaultCaBundler()
{
self::assertFileExists(Utils::defaultCaBundle());
self::assertFileExists(GuzzleHttp\default_ca_bundle());
}

public function testNormalizeHeaderKeys()
Expand All @@ -109,7 +104,6 @@ public function testNormalizeHeaderKeys()
$expected = ['hello' => 'HelLo', 'world' => 'WORld'];

self::assertSame($expected, Utils::normalizeHeaderKeys($input));
self::assertSame($expected, GuzzleHttp\normalize_header_keys($input));
}

public function noProxyProvider()
Expand All @@ -131,7 +125,6 @@ public function noProxyProvider()
public function testChecksNoProxyList($host, $list, $result)
{
self::assertSame($result, Utils::isHostInNoProxy($host, $list));
self::assertSame($result, \GuzzleHttp\is_host_in_noproxy($host, $list));
}

public function testEnsuresNoProxyCheckHostIsSet()
Expand All @@ -141,17 +134,9 @@ public function testEnsuresNoProxyCheckHostIsSet()
Utils::isHostInNoProxy('', []);
}

public function testEnsuresNoProxyCheckHostIsSetLegacy()
{
$this->expectException(\InvalidArgumentException::class);

\GuzzleHttp\is_host_in_noproxy('', []);
}

public function testEncodesJson()
{
self::assertSame('true', Utils::jsonEncode(true));
self::assertSame('true', \GuzzleHttp\json_encode(true));
}

public function testEncodesJsonAndThrowsOnError()
Expand All @@ -161,13 +146,6 @@ public function testEncodesJsonAndThrowsOnError()
Utils::jsonEncode("\x99");
}

public function testEncodesJsonAndThrowsOnErrorLegacy()
{
$this->expectException(\InvalidArgumentException::class);

\GuzzleHttp\json_encode("\x99");
}

public function testEncodesJsonAndThrowsOnErrorWithNativeOption()
{
$this->expectException(\InvalidArgumentException::class);
Expand All @@ -178,7 +156,6 @@ public function testEncodesJsonAndThrowsOnErrorWithNativeOption()
public function testDecodesJson()
{
self::assertTrue(Utils::jsonDecode('true'));
self::assertTrue(\GuzzleHttp\json_decode('true'));
}

public function testDecodesJsonAndThrowsOnError()
Expand All @@ -188,13 +165,6 @@ public function testDecodesJsonAndThrowsOnError()
Utils::jsonDecode('{{]]');
}

public function testDecodesJsonAndThrowsOnErrorLegacy()
{
$this->expectException(\InvalidArgumentException::class);

\GuzzleHttp\json_decode('{{]]');
}

public function testDecodesJsonAndThrowsOnErrorWithNativeOption()
{
$this->expectException(\InvalidArgumentException::class);
Expand Down

0 comments on commit 96c7505

Please sign in to comment.