Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions tests/Cookie/Jar/ConstructorTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -52,9 +52,9 @@ public function testValidInputType($input) {

$reflection = new ReflectionObject($obj);
$property = $reflection->getProperty('cookies');
$property->setAccessible(true);
(\PHP_VERSION_ID < 80100) && $property->setAccessible(true);
$property_value = $property->getValue($obj);
$property->setAccessible(false);
(\PHP_VERSION_ID < 80100) && $property->setAccessible(false);

$this->assertSame($input, $property_value, 'Cookies property has not been set to expected value');
}
Expand Down
4 changes: 2 additions & 2 deletions tests/Requests/HasCapabilitiesTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -23,13 +23,13 @@ public function testSucceedsForDetectingSsl() {

public function testFailsForUnsupportedCapabilities() {
$transports = new ReflectionProperty(Requests::class, 'transports');
$transports->setAccessible(true);
(\PHP_VERSION_ID < 80100) && $transports->setAccessible(true);
$transports->setValue(null, [TestTransportMock::class]);

$result = Requests::has_capabilities(['time-travel' => true]);

$transports->setValue(null, []);
$transports->setAccessible(false);
(\PHP_VERSION_ID < 80100) && $transports->setAccessible(false);

$this->assertFalse($result);
}
Expand Down
8 changes: 4 additions & 4 deletions tests/Utility/FilteredIterator/ConstructorTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -75,9 +75,9 @@ public function testValidCallback($input) {

$reflection = new ReflectionObject($obj);
$property = $reflection->getProperty('callback');
$property->setAccessible(true);
(\PHP_VERSION_ID < 80100) && $property->setAccessible(true);
$callback_value = $property->getValue($obj);
$property->setAccessible(false);
(\PHP_VERSION_ID < 80100) && $property->setAccessible(false);

$this->assertSame($input, $callback_value, 'Callback property has not been set');
}
Expand Down Expand Up @@ -108,9 +108,9 @@ public function testInvalidCallback($input) {

$reflection = new ReflectionObject($obj);
$property = $reflection->getProperty('callback');
$property->setAccessible(true);
(\PHP_VERSION_ID < 80100) && $property->setAccessible(true);
$callback_value = $property->getValue($obj);
$property->setAccessible(false);
(\PHP_VERSION_ID < 80100) && $property->setAccessible(false);

$this->assertNull($callback_value, 'Callback property has been set to invalid callback');
}
Expand Down
2 changes: 1 addition & 1 deletion tests/Utility/FilteredIterator/SerializationTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ public function testSerializeDeserializeObjects($value) {
$new_value = unserialize($serialized);
$reflection = new ReflectionClass(FilteredIterator::class);
$property = $reflection->getProperty('callback');
$property->setAccessible(true);
(\PHP_VERSION_ID < 80100) && $property->setAccessible(true);
$callback_value = $property->getValue($new_value);
$this->assertNull($callback_value, 'Callback is not null');
} else {
Expand Down
Loading