Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[10.x] Fix typos in tests #48534

Merged
merged 1 commit into from
Sep 25, 2023
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
2 changes: 1 addition & 1 deletion tests/Database/DatabaseEloquentDynamicRelationsTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ public function testInharitedDynamicRelations()

public function testInheritedDynamicRelationsOverride()
{
// Inherited Dynamic Relations can be overriden
// Inherited Dynamic Relations can be overridden
DynamicRelationModel::resolveRelationUsing('dynamicRelConflict', fn ($m) => $m->hasOne(Related::class));
$model = new DynamicRelationModel;
$model4 = new DynamicRelationModel4;
Expand Down
2 changes: 1 addition & 1 deletion tests/Database/DatabaseEloquentHasOneOfManyTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -463,7 +463,7 @@ public function testWithSoftDeletes()
$this->assertNotNull($user->latest_login_with_soft_deletes);
}

public function testWithContraintNotInAggregate()
public function testWithConstraintNotInAggregate()
{
$user = HasOneOfManyTestUser::create();

Expand Down
6 changes: 3 additions & 3 deletions tests/Database/DatabaseEloquentIntegrationTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,7 @@ protected function createSchema()
$table->timestamps();
});

$this->schema('default')->create('users_with_space_in_colum_name', function ($table) {
$this->schema('default')->create('users_with_space_in_column_name', function ($table) {
$table->increments('id');
$table->string('name')->nullable();
$table->string('email address');
Expand Down Expand Up @@ -734,7 +734,7 @@ public function testPluckWithColumnNameContainingASpace()
EloquentTestUserWithSpaceInColumnName::create(['id' => 1, 'email address' => 'taylorotwell@gmail.com']);
EloquentTestUserWithSpaceInColumnName::create(['id' => 2, 'email address' => 'abigailotwell@gmail.com']);

$simple = EloquentTestUserWithSpaceInColumnName::oldest('id')->pluck('users_with_space_in_colum_name.email address')->all();
$simple = EloquentTestUserWithSpaceInColumnName::oldest('id')->pluck('users_with_space_in_column_name.email address')->all();
$keyed = EloquentTestUserWithSpaceInColumnName::oldest('id')->pluck('email address', 'id')->all();

$this->assertEquals(['taylorotwell@gmail.com', 'abigailotwell@gmail.com'], $simple);
Expand Down Expand Up @@ -2266,7 +2266,7 @@ public function friends()

class EloquentTestUserWithSpaceInColumnName extends EloquentTestUser
{
protected $table = 'users_with_space_in_colum_name';
protected $table = 'users_with_space_in_column_name';
}

class EloquentTestNonIncrementing extends Eloquent
Expand Down
4 changes: 2 additions & 2 deletions tests/Database/DatabaseEloquentRelationTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -271,7 +271,7 @@ public function testMacroable()

public function testIsRelationIgnoresAttribute()
{
$model = new EloquentRelationAndAtrributeModelStub;
$model = new EloquentRelationAndAttributeModelStub;

$this->assertTrue($model->isRelation('parent'));
$this->assertFalse($model->isRelation('field'));
Expand Down Expand Up @@ -339,7 +339,7 @@ class EloquentNoTouchingAnotherModelStub extends Model
];
}

class EloquentRelationAndAtrributeModelStub extends Model
class EloquentRelationAndAttributeModelStub extends Model
{
protected $table = 'one_more_table';

Expand Down
2 changes: 1 addition & 1 deletion tests/Foundation/FoundationDocsCommandTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -296,7 +296,7 @@ public function testUnknownSystemNotifiedToOpenManually()
->assertSuccessful();
}

public function testGuessedMatchesThatDirectlyContainTheGivenStringRankHigerThanArbitraryMatches()
public function testGuessedMatchesThatDirectlyContainTheGivenStringRankHigherThanArbitraryMatches()
{
$this->artisan('docs ora')
->expectsOutputToContain('Opening the docs to: https://laravel.com/docs/8.x/filesystem')
Expand Down
10 changes: 5 additions & 5 deletions tests/Foundation/FoundationExceptionsHandlerTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -273,17 +273,17 @@ public function testValidateFileMethod()
$redirector = m::mock(Redirector::class);

$redirector->shouldReceive('to')->once()
->andReturn($responser = m::mock(RedirectResponse::class));
->andReturn($responder = m::mock(RedirectResponse::class));

$responser->shouldReceive('withInput')->once()->with(m::on(
$responder->shouldReceive('withInput')->once()->with(m::on(
function ($argument) use (&$argumentActual) {
$argumentActual = $argument;

return true;
}))->andReturn($responser);
}))->andReturn($responder);

$responser->shouldReceive('withErrors')->once()
->andReturn($responser);
$responder->shouldReceive('withErrors')->once()
->andReturn($responder);

return $redirector;
});
Expand Down
10 changes: 5 additions & 5 deletions tests/Foundation/Testing/Concerns/InteractsWithContainerTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -75,19 +75,19 @@ public function testWithMixRestoresOriginalHandlerAndReturnsInstance()

public function testForgetMock()
{
$this->mock(IntanceStub::class)
$this->mock(InstanceStub::class)
->shouldReceive('execute')
->once()
->andReturn('bar');

$this->assertSame('bar', $this->app->make(IntanceStub::class)->execute());
$this->assertSame('bar', $this->app->make(InstanceStub::class)->execute());

$this->forgetMock(IntanceStub::class);
$this->assertSame('foo', $this->app->make(IntanceStub::class)->execute());
$this->forgetMock(InstanceStub::class);
$this->assertSame('foo', $this->app->make(InstanceStub::class)->execute());
}
}

class IntanceStub
class InstanceStub
{
public function execute()
{
Expand Down
4 changes: 2 additions & 2 deletions tests/Http/Middleware/TrustProxiesTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -120,7 +120,7 @@ public function test_get_client_ips()
/**
* Test X-Forwarded-For header with multiple IP addresses, with some of those being trusted.
*/
public function test_get_client_ip_with_muliple_ip_addresses_some_of_which_are_trusted()
public function test_get_client_ip_with_multiple_ip_addresses_some_of_which_are_trusted()
{
$trustedProxy = $this->createTrustedProxy($this->headerAll, ['192.168.10.10', '192.0.2.199']);

Expand All @@ -143,7 +143,7 @@ public function test_get_client_ip_with_muliple_ip_addresses_some_of_which_are_t
/**
* Test X-Forwarded-For header with multiple IP addresses, with * wildcard trusting of all proxies.
*/
public function test_get_client_ip_with_muliple_ip_addresses_all_proxies_are_trusted()
public function test_get_client_ip_with_multiple_ip_addresses_all_proxies_are_trusted()
{
$trustedProxy = $this->createTrustedProxy($this->headerAll, '*');

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ public function testItFailsUsingCipherWithInvalidKey()
->assertExitCode(1);
}

public function testItFailsWhenEncyptionFileCannotBeFound()
public function testItFailsWhenEncryptionFileCannotBeFound()
{
$this->filesystem->shouldReceive('exists')->andReturn(true);

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -96,7 +96,7 @@ public function testItFailsWhenEnvironmentFileCannotBeFound()
->assertExitCode(1);
}

public function testItFailsWhenEncyptionFileExists()
public function testItFailsWhenEncryptionFileExists()
{
$this->filesystem->shouldReceive('exists')->andReturn(true);

Expand Down
6 changes: 3 additions & 3 deletions tests/Integration/Database/EloquentModelTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -76,14 +76,14 @@ public function testDiscardChanges()
$this->assertFalse($user->isDirty());
$this->assertFalse($user->wasChanged());

$user->name = $overideName = Str::random();
$user->name = $overrideName = Str::random();

$this->assertEquals(['name' => $overideName], $user->getDirty());
$this->assertEquals(['name' => $overrideName], $user->getDirty());
$this->assertEmpty($user->getChanges());
$this->assertTrue($user->isDirty());
$this->assertFalse($user->wasChanged());
$this->assertSame($originalName, $user->getOriginal('name'));
$this->assertSame($overideName, $user->getAttribute('name'));
$this->assertSame($overrideName, $user->getAttribute('name'));

$user->discardChanges();

Expand Down
2 changes: 1 addition & 1 deletion tests/Integration/Database/EloquentWhereTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -138,7 +138,7 @@ public function testWhereIn()
$this->assertCount(2, $users);
}

public function testWhereInCanAcceptQueriable()
public function testWhereInCanAcceptQueryable()
{
$user1 = UserWhereTest::create([
'name' => 'test-name1',
Expand Down
6 changes: 3 additions & 3 deletions tests/Integration/Http/ResourceTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -1220,7 +1220,7 @@ public function testOriginalOnResponseIsCollectionOfModelWhenCollectionResource(
});
}

public function testCollectionResourceWithPaginationInfomation()
public function testCollectionResourceWithPaginationInformation()
{
$posts = collect([
new Post(['id' => 5, 'title' => 'Test Title']),
Expand Down Expand Up @@ -1251,7 +1251,7 @@ public function testCollectionResourceWithPaginationInfomation()
]);
}

public function testResourceWithPaginationInfomation()
public function testResourceWithPaginationInformation()
{
$posts = collect([
new Post(['id' => 5, 'title' => 'Test Title']),
Expand Down Expand Up @@ -1346,7 +1346,7 @@ public function testKeysArePreservedIfTheResourceIsFlaggedToPreserveKeys()
$response->assertJson(['data' => $data]);
}

public function testKeysArePreservedInAnAnonymousColletionIfTheResourceIsFlaggedToPreserveKeys()
public function testKeysArePreservedInAnAnonymousCollectionIfTheResourceIsFlaggedToPreserveKeys()
{
$data = Collection::make([
[
Expand Down
2 changes: 1 addition & 1 deletion tests/Integration/Queue/typed-properties.php
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ class TypedPropertyTestClass

public ModelSerializationTestUser $user;

public ModelSerializationTestUser $unitializedUser;
public ModelSerializationTestUser $uninitializedUser;

protected int $id;

Expand Down
2 changes: 1 addition & 1 deletion tests/Integration/Routing/UrlSigningTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -169,7 +169,7 @@ public function testExceptedParametersCanBeAddedInAnyOrder()
$this->assertSame('valid', $this->get($url.'&two=value&one=&three')->original);
}

public function testUnusualExceptedParametersWorksAsExpexted()
public function testUnusualExceptedParametersWorksAsExpected()
{
$this->withoutExceptionHandling();
Route::get('/foo/{id}', function (Request $request, $id) {
Expand Down
2 changes: 1 addition & 1 deletion tests/Integration/Support/MultipleInstanceManagerTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ public function test_configurable_instances_can_be_resolved()
$this->assertEquals(spl_object_hash($barInstance), spl_object_hash($duplicateBarInstance));
}

public function test_unresolvable_isntances_throw_errors()
public function test_unresolvable_instances_throw_errors()
{
$this->expectException(RuntimeException::class);

Expand Down
2 changes: 1 addition & 1 deletion tests/Log/LogManagerTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -616,7 +616,7 @@ public function testItSharesContextWithFreshlyResolvedChannels()
$this->assertSame(['invocation-id' => 'expected-id'], $context);
}

public function testContextCanBePublicallyAccessedByOtherLoggingSystems()
public function testContextCanBePubliclyAccessedByOtherLoggingSystems()
{
$manager = new LogManager($this->app);
$context = null;
Expand Down
2 changes: 1 addition & 1 deletion tests/Process/ProcessTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -320,7 +320,7 @@ public function testProcessFakeSequencesCanThrowWhenSequenceIsEmpty()
$result = $factory->run('ls -la');
}

public function testStrayProcessesCanBePreventedWithStringComand()
public function testStrayProcessesCanBePreventedWithStringCommand()
{
$this->expectException(RuntimeException::class);
$this->expectExceptionMessage('Attempted process [');
Expand Down
2 changes: 1 addition & 1 deletion tests/Routing/RouteCollectionTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -298,7 +298,7 @@ public function testRouteCollectionRequestMethodNotAllowed()
$this->routeCollection->match($request);
}

public function testHasNameRouteMehod()
public function testHasNameRouteMethod()
{
$this->routeCollection->add(
new Route('GET', 'users', ['uses' => 'UsersController@index', 'as' => 'users'])
Expand Down
2 changes: 1 addition & 1 deletion tests/Support/SupportCollectionTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -4739,7 +4739,7 @@ public function testCollectionFromBackedEnum($collection)
/**
* @dataProvider collectionClassProvider
*/
public function testSplitCollectionWithADivisableCount($collection)
public function testSplitCollectionWithADivisibleCount($collection)
{
$data = new $collection(['a', 'b', 'c', 'd']);
$split = $data->split(2);
Expand Down
4 changes: 2 additions & 2 deletions tests/Support/SupportStrTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -172,8 +172,8 @@ public function testStrExcerpt()
$this->assertSame('...abc...', Str::excerpt('z abc d', 'b', ['radius' => 1]));
$this->assertSame('[...]is a beautiful morn[...]', Str::excerpt('This is a beautiful morning', 'beautiful', ['omission' => '[...]', 'radius' => 5]));
$this->assertSame(
'This is the ultimate supercalifragilisticexpialidoceous very looooooooooooooooooong looooooooooooong beautiful morning with amazing sunshine and awesome tempera[...]',
Str::excerpt('This is the ultimate supercalifragilisticexpialidoceous very looooooooooooooooooong looooooooooooong beautiful morning with amazing sunshine and awesome temperatures. So what are you gonna do about it?', 'very',
'This is the ultimate supercalifragilisticexpialidocious very looooooooooooooooooong looooooooooooong beautiful morning with amazing sunshine and awesome tempera[...]',
Str::excerpt('This is the ultimate supercalifragilisticexpialidocious very looooooooooooooooooong looooooooooooong beautiful morning with amazing sunshine and awesome temperatures. So what are you gonna do about it?', 'very',
['omission' => '[...]'],
));

Expand Down
2 changes: 1 addition & 1 deletion tests/Testing/Fluent/AssertTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -385,7 +385,7 @@ public function testAssertWhereFailsWhenMissing()
$assert->where('baz', 'invalid');
}

public function testAssertWhereFailsWhenMachingLoosely()
public function testAssertWhereFailsWhenMatchingLoosely()
{
$assert = AssertableJson::fromArray([
'bar' => 1,
Expand Down
2 changes: 1 addition & 1 deletion tests/View/ViewComponentAttributeBagTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -113,7 +113,7 @@ public function testItMakesAnExceptionForAlpineXdata()
$this->assertSame('required="required" x-data=""', (string) $bag);
}

public function testAttibuteExistence()
public function testAttributeExistence()
{
$bag = new ComponentAttributeBag(['name' => 'test']);

Expand Down