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
4 changes: 2 additions & 2 deletions tests/Broadcasting/BroadcasterTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -53,13 +53,13 @@ public function testExtractingParametersWhileCheckingForUserAccess()
//
};
$parameters = $this->broadcaster->extractAuthParameters('asd', 'asd', $callback);
$this->assertEquals([], $parameters);
$this->assertSame([], $parameters);

$callback = function ($user, $something) {
//
};
$parameters = $this->broadcaster->extractAuthParameters('asd', 'asd', $callback);
$this->assertEquals([], $parameters);
$this->assertSame([], $parameters);

// Test Explicit Binding...
$container = new Container;
Expand Down
2 changes: 1 addition & 1 deletion tests/Cache/CacheManagerTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -190,7 +190,7 @@ public function testItSetsDefaultDriverChangesGlobalConfig()

$cacheManager->setDefaultDriver('><((((@>');

$this->assertEquals('><((((@>', $app->get('config')->get('cache.default'));
$this->assertSame('><((((@>', $app->get('config')->get('cache.default'));
}

public function testItPurgesMemoizedStoreObjects()
Expand Down
2 changes: 1 addition & 1 deletion tests/Cache/CacheSessionStoreTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -207,7 +207,7 @@ public function testCacheKey()
public function testItemKey()
{
$store = new SessionStore(self::getSession(), 'custom_prefix');
$this->assertEquals('custom_prefix.foo', $store->itemKey('foo'));
$this->assertSame('custom_prefix.foo', $store->itemKey('foo'));
}

public function testValuesAreStoredByReference()
Expand Down
4 changes: 2 additions & 2 deletions tests/Console/CacheCommandMutexTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -166,7 +166,7 @@ public function testCommandMutexNameWithoutIsolatedMutexNameMethod()
$this->cacheRepository->shouldReceive('add')
->once()
->withArgs(function ($key) {
$this->assertEquals('framework'.DIRECTORY_SEPARATOR.'command-command-name', $key);
$this->assertSame('framework'.DIRECTORY_SEPARATOR.'command-command-name', $key);

return true;
})
Expand Down Expand Up @@ -196,7 +196,7 @@ public function isolatableId()
$this->cacheRepository->shouldReceive('add')
->once()
->withArgs(function ($key) {
$this->assertEquals('framework'.DIRECTORY_SEPARATOR.'command-command-name-isolated', $key);
$this->assertSame('framework'.DIRECTORY_SEPARATOR.'command-command-name-isolated', $key);

return true;
})
Expand Down
2 changes: 1 addition & 1 deletion tests/Container/AfterResolvingAttributeCallbackTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ public function testCallbackIsCalledAfterClassWithConstructorAndAttributeIsResol
$instance = $container->make(ContainerTestHasSelfConfiguringAttributeAndConstructor::class);

$this->assertInstanceOf(ContainerTestHasSelfConfiguringAttributeAndConstructor::class, $instance);
$this->assertEquals('the-right-value', $instance->value);
$this->assertSame('the-right-value', $instance->value);
}

public function testCallbackIsCalledOnAppCall()
Expand Down
2 changes: 1 addition & 1 deletion tests/Container/ContainerCallTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -129,7 +129,7 @@ public function testCallWithDependencies()
});

$this->assertInstanceOf(stdClass::class, $result[0]);
$this->assertEquals([], $result[1]);
$this->assertSame([], $result[1]);

$result = $container->call(function (stdClass $foo, $bar = []) {
return func_get_args();
Expand Down
8 changes: 3 additions & 5 deletions tests/Container/ContainerTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -661,7 +661,7 @@ public function testNestedParametersAreResetForFreshMake()
return $config;
});

$this->assertEquals([], $container->make('foo', ['something']));
$this->assertSame([], $container->make('foo', ['something']));
}

public function testSingletonBindingsNotRespectedWithMakeParameters()
Expand Down Expand Up @@ -920,7 +920,7 @@ public function testWithFactoryHasDependency()

$this->assertInstanceOf(RequestDto::class, $r);
$this->assertEquals(999, $r->userId);
$this->assertEquals('taylor@laravel.com', $r->email);
$this->assertSame('taylor@laravel.com', $r->email);
}

// public function testContainerCanCatchCircularDependency()
Expand Down Expand Up @@ -1118,9 +1118,7 @@ class WildcardConcrete implements WildcardOnlyInterface
{
}

/*
* The order of these attributes matters because we want to ensure we only fallback to '*' when there's no more specific environment.
*/
// The order of these attributes matters because we want to ensure we only fallback to '*' when there's no more specific environment.
#[Bind(FallbackConcrete::class)]
#[Bind(ProdConcrete::class, environments: 'prod')]
interface WildcardAndProdInterface
Expand Down
12 changes: 6 additions & 6 deletions tests/Container/ContextualAttributeBindingTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -100,7 +100,7 @@ public function testScalarDependencyCanBeResolvedFromAttributeBinding()
$class = $container->make(ContainerTestHasConfigValueProperty::class);

$this->assertInstanceOf(ContainerTestHasConfigValueProperty::class, $class);
$this->assertEquals('Europe/Paris', $class->timezone);
$this->assertSame('Europe/Paris', $class->timezone);
}

public function testScalarDependencyCanBeResolvedFromAttributeResolveMethod()
Expand All @@ -115,7 +115,7 @@ public function testScalarDependencyCanBeResolvedFromAttributeResolveMethod()
$class = $container->make(ContainerTestHasConfigValueWithResolveProperty::class);

$this->assertInstanceOf(ContainerTestHasConfigValueWithResolveProperty::class, $class);
$this->assertEquals('production', $class->env);
$this->assertSame('production', $class->env);
}

public function testDependencyWithAfterCallbackAttributeCanBeResolved()
Expand All @@ -124,7 +124,7 @@ public function testDependencyWithAfterCallbackAttributeCanBeResolved()

$class = $container->make(ContainerTestHasConfigValueWithResolvePropertyAndAfterCallback::class);

$this->assertEquals('Developer', $class->person->role);
$this->assertSame('Developer', $class->person->role);
}

public function testAuthedAttribute()
Expand Down Expand Up @@ -289,7 +289,7 @@ public function testInjectionWithAttributeOnAppCall()
return $hasAttribute->person;
});

$this->assertEquals('Taylor', $person->name);
$this->assertSame('Taylor', $person->name);
}

public function testAttributeOnAppCall()
Expand All @@ -306,7 +306,7 @@ public function testAttributeOnAppCall()
return $value;
});

$this->assertEquals('Europe/Paris', $value);
$this->assertSame('Europe/Paris', $value);

$value = $container->call(function (#[Config('app.locale')] ?string $value) {
return $value;
Expand All @@ -329,7 +329,7 @@ public function testNestedAttributeOnAppCall()
return $object;
});

$this->assertEquals('Europe/Paris', $value->timezone);
$this->assertSame('Europe/Paris', $value->timezone);

$value = $container->call(function (LocaleObject $object) {
return $object;
Expand Down
2 changes: 1 addition & 1 deletion tests/Container/UtilTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ public function testArrayWrap()
$this->assertEquals(['a'], Util::arrayWrap($string));
$this->assertEquals($array, Util::arrayWrap($array));
$this->assertEquals([$object], Util::arrayWrap($object));
$this->assertEquals([], Util::arrayWrap(null));
$this->assertSame([], Util::arrayWrap(null));
$this->assertEquals([null], Util::arrayWrap([null]));
$this->assertEquals([null, null], Util::arrayWrap([null, null]));
$this->assertEquals([''], Util::arrayWrap(''));
Expand Down
4 changes: 2 additions & 2 deletions tests/Cookie/CookieTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -82,15 +82,15 @@ public function testQueuedCookiesWithHandlingEmptyValues(): void
$cookie = $this->getCreator();
$cookie->queue($cookie->make('foo', ''));
$this->assertTrue($cookie->hasQueued('foo'));
$this->assertEquals('', $cookie->queued('foo')->getValue());
$this->assertSame('', $cookie->queued('foo')->getValue());
}

public function testQueuedCookiesWithRepeatedValue(): void
{
$cookie = $this->getCreator();
$cookie->queue($cookie->make('foo', 'newBar'));
$this->assertTrue($cookie->hasQueued('foo'));
$this->assertEquals('newBar', $cookie->queued('foo')->getValue());
$this->assertSame('newBar', $cookie->queued('foo')->getValue());

$this->expectException(ArgumentCountError::class);
$cookie->queue('invalidCookie');
Expand Down
2 changes: 1 addition & 1 deletion tests/Database/DatabaseConcernsHasAttributesTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ public function testCastingEmptyStringToArrayDoesNotError()
public function testUnsettingCachedAttribute()
{
$instance = new HasCacheableAttributeWithAccessor();
$this->assertEquals('foo', $instance->getAttribute('cacheableProperty'));
$this->assertSame('foo', $instance->getAttribute('cacheableProperty'));
$this->assertTrue($instance->cachedAttributeIsset('cacheableProperty'));

unset($instance->cacheableProperty);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -183,7 +183,7 @@ public function testMockedModelCallToWithoutRecursionMethodWorks(): void
fn () => array_merge($mock->attributesToArray(), $mock->relationsToArray()),
fn () => $mock->attributesToArray(),
);
$this->assertEquals([], $toArray);
$this->assertSame([], $toArray);
}
}

Expand Down
4 changes: 2 additions & 2 deletions tests/Database/DatabaseConnectionTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -552,8 +552,8 @@ public function testGetRawQueryLog()

$log = $mock->getRawQueryLog();

$this->assertEquals("select * from tbl where col = 'foo'", $log[0]['raw_query']);
$this->assertEquals(1.23, $log[0]['time']);
$this->assertSame("select * from tbl where col = 'foo'", $log[0]['raw_query']);
$this->assertSame(1.23, $log[0]['time']);
}

public function testQueryExceptionContainsReadConnectionDetailsWhenUsingReadPdo()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -530,7 +530,7 @@ public function testUpdateOrCreateMethodAcceptsClosureValuesAndUpdates(): void

$result = $model->newQuery()->updateOrCreate(['attr' => 'foo'], fn () => ['val' => 'baz']);
$this->assertFalse($result->wasRecentlyCreated);
$this->assertEquals('baz', $result->val);
$this->assertSame('baz', $result->val);
}

public function testUpdateOrCreateInvokesClosureExactlyOnceWhenCreating(): void
Expand Down
6 changes: 3 additions & 3 deletions tests/Database/DatabaseEloquentBuilderTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -336,7 +336,7 @@ public function testGetMethodDoesntHydrateEagerRelationsWhenNoResultsAreReturned
$builder->getModel()->shouldReceive('newCollection')->with([])->andReturn(new Collection([]));

$results = $builder->get(['foo']);
$this->assertEquals([], $results->all());
$this->assertSame([], $results->all());
}

public function testValueMethodWithModelFound()
Expand Down Expand Up @@ -1107,7 +1107,7 @@ public function testSimpleWhereNot()
$model = new EloquentBuilderTestStub();
$this->mockConnectionForModel($model, 'SQLite');
$query = $model->newQuery()->whereNot('name', 'foo')->whereNot('name', '<>', 'bar');
$this->assertEquals('select * from "table" where not "name" = ? and not "name" <> ?', $query->toSql());
$this->assertSame('select * from "table" where not "name" = ? and not "name" <> ?', $query->toSql());
$this->assertEquals(['foo', 'bar'], $query->getBindings());
}

Expand Down Expand Up @@ -1137,7 +1137,7 @@ public function testSimpleOrWhereNot()
$model = new EloquentBuilderTestStub();
$this->mockConnectionForModel($model, 'SQLite');
$query = $model->newQuery()->orWhereNot('name', 'foo')->orWhereNot('name', '<>', 'bar');
$this->assertEquals('select * from "table" where not "name" = ? or not "name" <> ?', $query->toSql());
$this->assertSame('select * from "table" where not "name" = ? or not "name" <> ?', $query->toSql());
$this->assertEquals(['foo', 'bar'], $query->getBindings());
}

Expand Down
14 changes: 7 additions & 7 deletions tests/Database/DatabaseEloquentCollectionTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -439,7 +439,7 @@ public function testCollectionIntersectWithNull()

$c1 = new Collection([$one, $two, $three]);

$this->assertEquals([], $c1->intersect(null)->all());
$this->assertSame([], $c1->intersect(null)->all());
}

public function testCollectionIntersectsWithGivenCollection()
Expand Down Expand Up @@ -543,7 +543,7 @@ public function testMakeVisibleRemovesHiddenFromEntireCollection()
$c = new Collection([new TestEloquentCollectionModel]);
$c = $c->makeVisible(['hidden']);

$this->assertEquals([], $c[0]->getHidden());
$this->assertSame([], $c[0]->getHidden());
}

public function testMergeHiddenAddsHiddenOnEntireCollection()
Expand Down Expand Up @@ -602,7 +602,7 @@ public function testWithoutAppendsRemovesAppendsOnEntireCollection()
{
$this->seedData();
$c = EloquentAppendingTestUserModel::query()->get();
$this->assertEquals('hello', $c->toArray()[0]['appended_field']);
$this->assertSame('hello', $c->toArray()[0]['appended_field']);

$c = $c->withoutAppends();
$this->assertArrayNotHasKey('appended_field', $c->toArray()[0]);
Expand All @@ -628,7 +628,7 @@ public function testMakeVisibleRemovesHiddenAndIncludesVisible()
$c = new Collection([new TestEloquentCollectionModel]);
$c = $c->makeVisible('hidden');

$this->assertEquals([], $c[0]->getHidden());
$this->assertSame([], $c[0]->getHidden());
$this->assertEquals(['visible', 'hidden'], $c[0]->getVisible());
}

Expand All @@ -639,8 +639,8 @@ public function testMultiply()

$c = new Collection([$a, $b]);

$this->assertEquals([], $c->multiply(-1)->all());
$this->assertEquals([], $c->multiply(0)->all());
$this->assertSame([], $c->multiply(-1)->all());
$this->assertSame([], $c->multiply(0)->all());

$this->assertEquals([$a, $b], $c->multiply(1)->all());

Expand Down Expand Up @@ -704,7 +704,7 @@ public function getQueueableRelations()
},
]);

$this->assertEquals([], $c->getQueueableRelations());
$this->assertSame([], $c->getQueueableRelations());
}

public function testEmptyCollectionStayEmptyOnFresh()
Expand Down
22 changes: 11 additions & 11 deletions tests/Database/DatabaseEloquentFactoryTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -185,7 +185,7 @@ public function test_expanded_closure_attribute_returning_a_factory_is_resolved(
]),
]);

$this->assertEquals('post-options', $post->user->options);
$this->assertSame('post-options', $post->user->options);
}

public function test_make_creates_unpersisted_model_instance()
Expand Down Expand Up @@ -1031,56 +1031,56 @@ public function test_factory_model_has_many_relationship_has_pending_attributes(
{
FactoryTestUser::factory()->has(new FactoryTestPostFactory(), 'postsWithFooBarBazAsTitle')->create();

$this->assertEquals('foo bar baz', FactoryTestPost::first()->title);
$this->assertSame('foo bar baz', FactoryTestPost::first()->title);
}

public function test_factory_model_has_many_relationship_has_pending_attributes_override()
{
FactoryTestUser::factory()->has((new FactoryTestPostFactory())->state(['title' => 'other title']), 'postsWithFooBarBazAsTitle')->create();

$this->assertEquals('other title', FactoryTestPost::first()->title);
$this->assertSame('other title', FactoryTestPost::first()->title);
}

public function test_factory_model_has_one_relationship_has_pending_attributes()
{
FactoryTestUser::factory()->has(new FactoryTestPostFactory(), 'postWithFooBarBazAsTitle')->create();

$this->assertEquals('foo bar baz', FactoryTestPost::first()->title);
$this->assertSame('foo bar baz', FactoryTestPost::first()->title);
}

public function test_factory_model_has_one_relationship_has_pending_attributes_override()
{
FactoryTestUser::factory()->has((new FactoryTestPostFactory())->state(['title' => 'other title']), 'postWithFooBarBazAsTitle')->create();

$this->assertEquals('other title', FactoryTestPost::first()->title);
$this->assertSame('other title', FactoryTestPost::first()->title);
}

public function test_factory_model_belongs_to_many_relationship_has_pending_attributes()
{
FactoryTestUser::factory()->has(new FactoryTestRoleFactory(), 'rolesWithFooBarBazAsName')->create();

$this->assertEquals('foo bar baz', FactoryTestRole::first()->name);
$this->assertSame('foo bar baz', FactoryTestRole::first()->name);
}

public function test_factory_model_belongs_to_many_relationship_has_pending_attributes_override()
{
FactoryTestUser::factory()->has((new FactoryTestRoleFactory())->state(['name' => 'other name']), 'rolesWithFooBarBazAsName')->create();

$this->assertEquals('other name', FactoryTestRole::first()->name);
$this->assertSame('other name', FactoryTestRole::first()->name);
}

public function test_factory_model_morph_many_relationship_has_pending_attributes()
{
(new FactoryTestPostFactory())->has(new FactoryTestCommentFactory(), 'commentsWithFooBarBazAsBody')->create();

$this->assertEquals('foo bar baz', FactoryTestComment::first()->body);
$this->assertSame('foo bar baz', FactoryTestComment::first()->body);
}

public function test_factory_model_morph_many_relationship_has_pending_attributes_override()
{
(new FactoryTestPostFactory())->has((new FactoryTestCommentFactory())->state(['body' => 'other body']), 'commentsWithFooBarBazAsBody')->create();

$this->assertEquals('other body', FactoryTestComment::first()->body);
$this->assertSame('other body', FactoryTestComment::first()->body);
}

public function test_factory_can_insert()
Expand All @@ -1107,9 +1107,9 @@ public function test_factory_can_insert_with_hidden()
{
(new FactoryTestUserFactory())->forEachSequence(['name' => Name::Taylor, 'options' => 'abc'])->insert();
$user = DB::table('users')->sole();
$this->assertEquals('abc', $user->options);
$this->assertSame('abc', $user->options);
$userModel = FactoryTestUser::query()->sole();
$this->assertEquals('abc', $userModel->options);
$this->assertSame('abc', $userModel->options);
}

public function test_factory_can_insert_with_array_casts()
Expand Down
Loading
Loading