Skip to content

Commit adcc832

Browse files
committed
Remove usages of the deprecated helpers
1 parent c47633e commit adcc832

File tree

4 files changed

+8
-4
lines changed

4 files changed

+8
-4
lines changed

src/Asserts/ArtisanAsserts.php

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33
namespace Illuminated\Testing\Asserts;
44

55
use Mockery;
6+
use Illuminate\Support\Str;
67
use Illuminate\Support\Facades\File;
78

89
trait ArtisanAsserts
@@ -114,7 +115,7 @@ private function parseArtisanTableOutput($output)
114115
$headers = [];
115116
$outputRows = explode("\n", trim($output));
116117
foreach ($outputRows as $row) {
117-
if (!str_contains($row, '|')) {
118+
if (!Str::contains($row, '|')) {
118119
continue;
119120
}
120121

src/Asserts/EloquentAsserts.php

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22

33
namespace Illuminated\Testing\Asserts;
44

5+
use Illuminate\Support\Str;
56
use Illuminate\Database\Eloquent\Relations\HasMany;
67
use Illuminate\Database\Eloquent\Relations\BelongsTo;
78

@@ -92,7 +93,7 @@ protected function assertEloquentHasCreateFor($class, $relation, $createMethod =
9293
$hasManyRelation = (new $class)->{$relation}();
9394
$this->assertInstanceOf(HasMany::class, $hasManyRelation);
9495

95-
$createMethod = !empty($createMethod) ? $createMethod : 'create' . title_case(str_singular($relation));
96+
$createMethod = !empty($createMethod) ? $createMethod : 'create' . Str::title(Str::singular($relation));
9697
$this->assertMethodExists($class, $createMethod);
9798

9899
$parent = factory($class)->create();

src/Asserts/LogFileAsserts.php

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22

33
namespace Illuminated\Testing\Asserts;
44

5+
use Illuminate\Support\Str;
56
use Illuminate\Support\Facades\File;
67

78
trait LogFileAsserts
@@ -47,7 +48,7 @@ private function composeLogFilePath($path)
4748

4849
private function normalizeExpectedLogFileContent($content)
4950
{
50-
$content = '/' . preg_quote($content, '/') . (starts_with($content, 'array:') ? '' : '\n') . '/';
51+
$content = '/' . preg_quote($content, '/') . (Str::startsWith($content, 'array:') ? '' : '\n') . '/';
5152
$content = str_replace('%datetime%', '\d{4}-\d{2}-\d{2} \d{2}\:\d{2}\:\d{2}', $content);
5253

5354
return $content;

src/Asserts/ScheduleAsserts.php

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22

33
namespace Illuminated\Testing\Asserts;
44

5+
use Illuminate\Support\Str;
56
use Illuminate\Console\Scheduling\Event;
67
use Illuminate\Console\Scheduling\Schedule;
78

@@ -46,7 +47,7 @@ private function getScheduleEvent($command)
4647
$schedule = app(Schedule::class);
4748

4849
foreach ($schedule->events() as $event) {
49-
if (ends_with($event->command, $command)) {
50+
if (Str::endsWith($event->command, $command)) {
5051
return $event;
5152
}
5253
}

0 commit comments

Comments
 (0)