Skip to content

Commit cdd675a

Browse files
committed
fix broken tests with removal of str_studly
1 parent dafbb6c commit cdd675a

File tree

2 files changed

+7
-5
lines changed

2 files changed

+7
-5
lines changed

src/Updater.php

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@
88
use distinctm\LaravelDataSync\Exceptions\NoRecordsInvalidJSONException;
99
use Illuminate\Support\Collection;
1010
use Illuminate\Support\Facades\File;
11+
use Illuminate\Support\Str;
1112
use stdClass;
1213

1314
class Updater
@@ -134,7 +135,7 @@ protected function sortModels(\Illuminate\Support\Collection $files)
134135
$filename = pathinfo($file, PATHINFO_FILENAME);
135136

136137
$order = array_search(
137-
studly_case($filename),
138+
Str::studly($filename),
138139
config('data-sync.order')
139140
);
140141

@@ -197,7 +198,7 @@ protected function getValues(stdClass $record)
197198
*/
198199
protected function getModel(string $name)
199200
{
200-
return '\\App\\'.studly_case(pathinfo($name, PATHINFO_FILENAME));
201+
return '\\App\\'.Str::studly(pathinfo($name, PATHINFO_FILENAME));
201202
}
202203

203204
/**

tests/fakes/UpdaterFake.php

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,13 +3,14 @@
33
namespace distinctm\LaravelDataSync\Tests\Fakes;
44

55
use distinctm\LaravelDataSync\Updater;
6+
use Illuminate\Support\Str;
67

78
class UpdaterFake extends Updater
89
{
910
protected function getModel(string $name)
1011
{
11-
return '\\distinctm\\LaravelDataSync\\Tests\\'.studly_case(
12-
pathinfo($name, PATHINFO_FILENAME)
13-
);
12+
return '\\distinctm\\LaravelDataSync\\Tests\\'.Str::studly(
13+
pathinfo($name, PATHINFO_FILENAME)
14+
);
1415
}
1516
}

0 commit comments

Comments
 (0)