Skip to content

Commit

Permalink
[8.0] Remove deprecated functions (#3210)
Browse files Browse the repository at this point in the history
* Remove deprecated functions

* Update UtilsTest.php

* Update UtilsTest.php

* Update UtilsTest.php
  • Loading branch information
GrahamCampbell committed Mar 31, 2024
1 parent 187c2d9 commit 4d34863
Show file tree
Hide file tree
Showing 4 changed files with 1 addition and 210 deletions.
5 changes: 1 addition & 4 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -118,10 +118,7 @@
"autoload": {
"psr-4": {
"GuzzleHttp\\": "src/"
},
"files": [
"src/functions_include.php"
]
}
},
"autoload-dev": {
"psr-4": {
Expand Down
167 changes: 0 additions & 167 deletions src/functions.php

This file was deleted.

6 changes: 0 additions & 6 deletions src/functions_include.php

This file was deleted.

33 changes: 0 additions & 33 deletions tests/UtilsTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@

namespace GuzzleHttp\Test;

use GuzzleHttp;
use GuzzleHttp\Utils;
use PHPUnit\Framework\TestCase;

Expand Down Expand Up @@ -43,7 +42,6 @@ public function testDescribesType($input, $output)

try {
self::assertSame($output, Utils::describeType($input));
self::assertSame($output, GuzzleHttp\describe_type($input));
} finally {
if (extension_loaded('xdebug')) {
ini_set('xdebug.overload_var_dump', $originalOverload);
Expand All @@ -67,7 +65,6 @@ public function testParsesHeadersFromLines()
];

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

public function testParsesHeadersFromLinesWithMultipleLines()
Expand All @@ -76,31 +73,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 +101,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 +122,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 +131,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 +143,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 +153,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 +162,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 4d34863

Please sign in to comment.