Skip to content
Merged
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
10 changes: 8 additions & 2 deletions .github/workflows/tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -39,8 +39,11 @@ jobs:
strategy:
fail-fast: true
matrix:
php: ['8.0', '8.1']
php: ['8.0', 8.1]
stability: [prefer-lowest, prefer-stable]
include:
- php: 8.2
stability: prefer-stable --ignore-platform-req=php+

name: PHP ${{ matrix.php }} - ${{ matrix.stability }}

Expand Down Expand Up @@ -107,8 +110,11 @@ jobs:
strategy:
fail-fast: true
matrix:
php: ['8.0', '8.1']
php: ['8.0', 8.1]
stability: [prefer-lowest, prefer-stable]
include:
- php: 8.2
stability: prefer-stable --ignore-platform-req=php+

name: PHP ${{ matrix.php }} - ${{ matrix.stability }} - Windows

Expand Down
1 change: 1 addition & 0 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -81,6 +81,7 @@
"illuminate/view": "self.version"
},
"require-dev": {
"ably/ably-php": "^1.0",
"aws/aws-sdk-php": "^3.198.1",
"doctrine/dbal": "^2.13.3|^3.1.4",
"fakerphp/faker": "^1.9.2",
Expand Down
14 changes: 14 additions & 0 deletions src/Illuminate/Http/Client/Response.php
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,20 @@ class Response implements ArrayAccess
*/
protected $decoded;

/**
* The request cookies.
*
* @var \GuzzleHttp\Cookie\CookieJar
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It's odd since on PendingRequest this is an array. Not sure why it's different here.

*/
public $cookies;

/**
* The transfer stats for the request.
*
* \GuzzleHttp\TransferStats|null
*/
public $transferStats;

/**
* Create a new response instance.
*
Expand Down
15 changes: 13 additions & 2 deletions tests/Broadcasting/AblyBroadcasterTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@

namespace Illuminate\Tests\Broadcasting;

use Ably\AblyRest;
use Illuminate\Broadcasting\Broadcasters\AblyBroadcaster;
use Illuminate\Http\Request;
use Mockery as m;
Expand All @@ -19,14 +20,24 @@ class AblyBroadcasterTest extends TestCase

protected function setUp(): void
{
if (phpversion() >= '8.2') {
$this->markTestSkipped('Tests are broken on PHP 8.2');
}

parent::setUp();

$this->ably = m::mock('Ably\AblyRest');
$this->ably->options = (object) ['key' => 'abcd:efgh'];
$this->ably = m::mock(AblyRest::class, ['abcd:efgh']);

$this->broadcaster = m::mock(AblyBroadcaster::class, [$this->ably])->makePartial();
}

protected function tearDown(): void
{
parent::tearDown();

m::close();
}

public function testAuthCallValidAuthenticationResponseWithPrivateChannelWhenCallbackReturnTrue()
{
$this->broadcaster->channel('test', function () {
Expand Down
5 changes: 2 additions & 3 deletions tests/Broadcasting/PusherBroadcasterTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -178,8 +178,7 @@ public function testUserAuthenticationForPusher()
protected function getMockRequestWithUserForChannel($channel)
{
$request = m::mock(Request::class);
$request->channel_name = $channel;
$request->socket_id = 'abcd.1234';
$request->shouldReceive('all')->andReturn(['channel_name' => $channel, 'socket_id' => 'abcd.1234']);

$request->shouldReceive('input')
->with('callback', false)
Expand All @@ -204,7 +203,7 @@ protected function getMockRequestWithUserForChannel($channel)
protected function getMockRequestWithoutUserForChannel($channel)
{
$request = m::mock(Request::class);
$request->channel_name = $channel;
$request->shouldReceive('all')->andReturn(['channel_name' => $channel]);

$request->shouldReceive('user')
->andReturn(null);
Expand Down
5 changes: 3 additions & 2 deletions tests/Broadcasting/RedisBroadcasterTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -167,7 +167,8 @@ protected function createConfig()
protected function getMockRequestWithUserForChannel($channel)
{
$request = m::mock(Request::class);
$request->channel_name = $channel;
$request->shouldReceive('all')->andReturn(['channel_name' => $channel]);
$request->shouldReceive('all')->andReturn(['channel_name' => $channel]);

$user = m::mock('User');
$user->shouldReceive('getAuthIdentifierForBroadcasting')
Expand All @@ -188,7 +189,7 @@ protected function getMockRequestWithUserForChannel($channel)
protected function getMockRequestWithoutUserForChannel($channel)
{
$request = m::mock(Request::class);
$request->channel_name = $channel;
$request->shouldReceive('all')->andReturn(['channel_name' => $channel]);

$request->shouldReceive('user')
->andReturn(null);
Expand Down
2 changes: 2 additions & 0 deletions tests/Database/DatabaseEloquentModelTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,8 @@ class DatabaseEloquentModelTest extends TestCase
{
use InteractsWithTime;

protected $encrypter;

protected function tearDown(): void
{
parent::tearDown();
Expand Down
2 changes: 2 additions & 0 deletions tests/Database/DatabaseQueryBuilderTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,8 @@

class DatabaseQueryBuilderTest extends TestCase
{
protected $called;

protected function tearDown(): void
{
m::close();
Expand Down
2 changes: 2 additions & 0 deletions tests/Database/DatabaseSoftDeletingTraitTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -61,9 +61,11 @@ public function testRestoreCancel()
class DatabaseSoftDeletingTraitStub
{
use SoftDeletes;

public $deleted_at;
public $updated_at;
public $timestamps = true;
public $exists = false;

public function newQuery()
{
Expand Down
4 changes: 4 additions & 0 deletions tests/Foundation/Bootstrap/HandleExceptionsTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,10 @@

class HandleExceptionsTest extends TestCase
{
protected $app;
protected $config;
protected $handleExceptions;

protected function setUp(): void
{
$this->app = m::mock(Application::setInstance(new Application));
Expand Down
13 changes: 12 additions & 1 deletion tests/Foundation/Testing/DatabaseMigrationsTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ protected function setUp(): void
{
RefreshDatabaseState::$migrated = false;

$this->traitObject = $this->getMockForTrait(DatabaseMigrations::class, [], '', true, true, true, [
$this->traitObject = $this->getMockForAbstractClass(DatabaseMigrationsTestMockClass::class, [], '', true, true, true, [
'artisan',
'beforeApplicationDestroyed',
]);
Expand Down Expand Up @@ -95,3 +95,14 @@ public function testRefreshTestDatabaseWithDropTypesOption()
$refreshTestDatabaseReflection->invoke($this->traitObject);
}
}

class DatabaseMigrationsTestMockClass
{
use DatabaseMigrations;

public $app;

public $dropViews = false;

public $dropTypes = false;
}
13 changes: 12 additions & 1 deletion tests/Foundation/Testing/RefreshDatabaseTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ protected function setUp(): void
{
RefreshDatabaseState::$migrated = false;

$this->traitObject = $this->getMockForTrait(RefreshDatabase::class, [], '', true, true, true, [
$this->traitObject = $this->getMockForAbstractClass(RefreshDatabaseTestMockClass::class, [], '', true, true, true, [
'artisan',
'beginDatabaseTransaction',
]);
Expand Down Expand Up @@ -95,3 +95,14 @@ public function testRefreshTestDatabaseWithDropTypesOption()
$refreshTestDatabaseReflection->invoke($this->traitObject);
}
}

class RefreshDatabaseTestMockClass
{
use RefreshDatabase;

public $app;

public $dropViews = false;

public $dropTypes = false;
}
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ class CanConfigureMigrationCommandsTest extends TestCase

protected function setUp(): void
{
$this->traitObject = $this->getObjectForTrait(CanConfigureMigrationCommands::class);
$this->traitObject = $this->getMockForAbstractClass(CanConfigureMigrationCommandsTestMockClass::class);
}

private function __reflectAndSetupAccessibleForProtectedTraitMethod($methodName)
Expand Down Expand Up @@ -77,3 +77,12 @@ public function testMigrateFreshUsingWithPropertySets(): void
$this->assertEquals($expected, $migrateFreshUsingReflection->invoke($this->traitObject));
}
}

class CanConfigureMigrationCommandsTestMockClass
{
use CanConfigureMigrationCommands;

public $dropViews = false;

public $dropTypes = false;
}
2 changes: 2 additions & 0 deletions tests/Mail/AttachableTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -81,6 +81,8 @@ public function testItCanUtiliseExistingApisOnNonMailBasedResourcesWithArgs()
{
public $pathArgs;

public $dataArgs;

public function withDataAttachment()
{
$this->dataArgs = func_get_args();
Expand Down
2 changes: 1 addition & 1 deletion tests/Queue/DatabaseFailedJobProviderTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ public function testCanProperlyLogFailedJob()

$uuid = Str::uuid();

$exception = new Exception(utf8_decode('ÐÑÙ0E\xE2\x�98\xA0World��7B¹!þÿ'));
$exception = new Exception(mb_convert_encoding('ÐÑÙ0E\xE2\x�98\xA0World��7B¹!þÿ', 'ISO-8859-1', 'UTF-8'));
$provider = new DatabaseFailedJobProvider($db->getDatabaseManager(), 'default', 'failed_jobs');

$provider->log('database', 'default', json_encode(['uuid' => (string) $uuid]), $exception);
Expand Down
18 changes: 18 additions & 0 deletions tests/Queue/QueueSqsJobTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,24 @@

class QueueSqsJobTest extends TestCase
{
protected $key;
protected $secret;
protected $service;
protected $region;
protected $account;
protected $queueName;
protected $baseUrl;
protected $releaseDelay;
protected $queueUrl;
protected $mockedSqsClient;
protected $mockedContainer;
protected $mockedJob;
protected $mockedData;
protected $mockedPayload;
protected $mockedMessageId;
protected $mockedReceiptHandle;
protected $mockedJobData;

protected function setUp(): void
{
$this->key = 'AMAZONSQSKEY';
Expand Down
17 changes: 17 additions & 0 deletions tests/Queue/QueueSqsQueueTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,23 @@

class QueueSqsQueueTest extends TestCase
{
protected $sqs;
protected $account;
protected $queueName;
protected $baseUrl;
protected $prefix;
protected $queueUrl;
protected $mockedJob;
protected $mockedData;
protected $mockedPayload;
protected $mockedDelay;
protected $mockedMessageId;
protected $mockedReceiptHandle;
protected $mockedSendMessageResponseModel;
protected $mockedReceiveMessageResponseModel;
protected $mockedReceiveEmptyMessageResponseModel;
protected $mockedQueueAttributesResponseModel;

protected function tearDown(): void
{
m::close();
Expand Down
1 change: 1 addition & 0 deletions tests/Queue/QueueWorkerTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@ class QueueWorkerTest extends TestCase
{
public $events;
public $exceptionHandler;
public $maintenanceFlags;

protected function setUp(): void
{
Expand Down
2 changes: 2 additions & 0 deletions tests/Support/SupportTestingEventFakeTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,8 @@

class SupportTestingEventFakeTest extends TestCase
{
protected $fake;

protected function setUp(): void
{
parent::setUp();
Expand Down