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: 5 additions & 5 deletions tests/Bus/BusBatchTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -113,7 +113,7 @@ public function test_jobs_can_be_added_to_the_batch()

$this->assertEquals(3, $batch->totalJobs);
$this->assertEquals(3, $batch->pendingJobs);
$this->assertTrue(is_string($job->batchId));
$this->assertIsString($job->batchId);
$this->assertInstanceOf(CarbonImmutable::class, $batch->createdAt);
}

Expand Down Expand Up @@ -301,7 +301,7 @@ public function test_batch_state_can_be_inspected()
$batch->cancelledAt = now();
$this->assertTrue($batch->cancelled());

$this->assertTrue(is_string(json_encode($batch)));
$this->assertIsString(json_encode($batch));
}

public function test_chain_can_be_added_to_batch()
Expand Down Expand Up @@ -334,9 +334,9 @@ public function test_chain_can_be_added_to_batch()
$this->assertEquals(3, $batch->totalJobs);
$this->assertEquals(3, $batch->pendingJobs);
$this->assertSame('test-queue', $chainHeadJob->chainQueue);
$this->assertTrue(is_string($chainHeadJob->batchId));
$this->assertTrue(is_string($secondJob->batchId));
$this->assertTrue(is_string($thirdJob->batchId));
$this->assertIsString($chainHeadJob->batchId);
$this->assertIsString($secondJob->batchId);
$this->assertIsString($thirdJob->batchId);
$this->assertInstanceOf(CarbonImmutable::class, $batch->createdAt);
}

Expand Down
4 changes: 2 additions & 2 deletions tests/Database/DatabaseEloquentIntegrationTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -811,12 +811,12 @@ public function testBelongsToManyRelationshipModelsAreProperlyHydratedWithSoleQu
$user->friends()->create(['email' => '[email protected]']);

$user->friends()->get()->each(function ($friend) {
$this->assertTrue($friend->pivot instanceof EloquentTestFriendPivot);
$this->assertInstanceOf(EloquentTestFriendPivot::class, $friend->pivot);
});

$soleFriend = $user->friends()->where('email', '[email protected]')->sole();

$this->assertTrue($soleFriend->pivot instanceof EloquentTestFriendPivot);
$this->assertInstanceOf(EloquentTestFriendPivot::class, $soleFriend->pivot);
}

public function testBelongsToManyRelationshipMissingModelExceptionWithSoleQueryWorks()
Expand Down
14 changes: 7 additions & 7 deletions tests/Http/HttpRequestTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -1024,7 +1024,7 @@ public function testMagicMethods()
// Parameter 'foo' is 'bar', then it ISSET and is NOT EMPTY.
$this->assertSame('bar', $request->foo);
$this->assertTrue(isset($request->foo));
$this->assertFalse(empty($request->foo));
$this->assertNotEmpty($request->foo);

// Parameter 'empty' is '', then it ISSET and is EMPTY.
$this->assertSame('', $request->empty);
Expand All @@ -1034,7 +1034,7 @@ public function testMagicMethods()
// Parameter 'undefined' is undefined/null, then it NOT ISSET and is EMPTY.
$this->assertNull($request->undefined);
$this->assertFalse(isset($request->undefined));
$this->assertTrue(empty($request->undefined));
$this->assertEmpty($request->undefined);

// Simulates Route parameters.
$request = Request::create('/example/bar', 'GET', ['xyz' => 'overwritten']);
Expand All @@ -1049,18 +1049,18 @@ public function testMagicMethods()
$this->assertSame('bar', $request->foo);
$this->assertSame('bar', $request['foo']);
$this->assertTrue(isset($request->foo));
$this->assertFalse(empty($request->foo));
$this->assertNotEmpty($request->foo);

// Router parameter 'undefined' is undefined/null, then it NOT ISSET and is EMPTY.
$this->assertNull($request->undefined);
$this->assertFalse(isset($request->undefined));
$this->assertTrue(empty($request->undefined));
$this->assertEmpty($request->undefined);

// Special case: router parameter 'xyz' is 'overwritten' by QueryString, then it ISSET and is NOT EMPTY.
// Basically, QueryStrings have priority over router parameters.
$this->assertSame('overwritten', $request->xyz);
$this->assertTrue(isset($request->foo));
$this->assertFalse(empty($request->foo));
$this->assertNotEmpty($request->foo);

// Simulates empty QueryString and Routes.
$request = Request::create('/', 'GET');
Expand All @@ -1074,7 +1074,7 @@ public function testMagicMethods()
// Parameter 'undefined' is undefined/null, then it NOT ISSET and is EMPTY.
$this->assertNull($request->undefined);
$this->assertFalse(isset($request->undefined));
$this->assertTrue(empty($request->undefined));
$this->assertEmpty($request->undefined);

// Special case: simulates empty QueryString and Routes, without the Route Resolver.
// It'll happen when you try to get a parameter outside a route.
Expand All @@ -1083,7 +1083,7 @@ public function testMagicMethods()
// Parameter 'undefined' is undefined/null, then it NOT ISSET and is EMPTY.
$this->assertNull($request->undefined);
$this->assertFalse(isset($request->undefined));
$this->assertTrue(empty($request->undefined));
$this->assertEmpty($request->undefined);
}

public function testHttpRequestFlashCallsSessionFlashInputWithInputData()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -106,7 +106,7 @@ public function testBasicCustomCasting()

$model = new TestEloquentModelWithCustomCast;
$model->birthday_at = now();
$this->assertTrue(is_string($model->toArray()['birthday_at']));
$this->assertIsString($model->toArray()['birthday_at']);
}

public function testGetOriginalWithCastValueObjects()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@

use Illuminate\Database\Schema\Blueprint;
use Illuminate\Support\Facades\Schema;
use stdClass;

class DatabaseSchemaBuilderAlterTableWithEnumTest extends DatabaseMySqlTestCase
{
Expand All @@ -30,7 +31,7 @@ public function testGetAllTablesAndColumnListing()
$tables = Schema::getAllTables();

$this->assertCount(1, $tables);
$this->assertSame('stdClass', get_class($tables[0]));
$this->assertInstanceOf(stdClass::class, $tables[0]);

$tableProperties = array_values((array) $tables[0]);
$this->assertEquals(['users', 'BASE TABLE'], $tableProperties);
Expand Down
2 changes: 1 addition & 1 deletion tests/Integration/Http/ResourceTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -781,7 +781,7 @@ public function testCollectionResourcesAreCountable()
$collection = new PostCollectionResource($posts);

$this->assertCount(2, $collection);
$this->assertSame(2, count($collection));
$this->assertCount(2, $collection);
}

public function testKeysArePreservedIfTheResourceIsFlaggedToPreserveKeys()
Expand Down
2 changes: 1 addition & 1 deletion tests/Validation/ValidationAddFailureTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ public function testAddFailureExists()
$validator = $this->makeValidator();
$method_name = 'addFailure';
$this->assertTrue(method_exists($validator, $method_name));
$this->assertTrue(is_callable([$validator, $method_name]));
$this->assertIsCallable([$validator, $method_name]);
}

public function testAddFailureIsFunctional()
Expand Down
2 changes: 1 addition & 1 deletion tests/Validation/ValidationValidatorTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -5238,7 +5238,7 @@ public function message()
);

$this->assertFalse($v->passes());
$this->assertTrue(is_array($v->failed()['foo.foo.bar']));
$this->assertIsArray($v->failed()['foo.foo.bar']);
}

public function testImplicitCustomValidationObjects()
Expand Down