Skip to content

Commit 45f7522

Browse files
authored
Merge pull request #220 from kenjis/fix-Setup-replace
fix: `use` is missing in the replaced source files
2 parents 50e0f05 + 0c12f7a commit 45f7522

File tree

2 files changed

+3
-2
lines changed

2 files changed

+3
-2
lines changed

src/Commands/Setup.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -108,7 +108,7 @@ private function publishConfigAuth(): void
108108
$file = 'Config/Auth.php';
109109
$replaces = [
110110
'namespace CodeIgniter\Shield\Config' => 'namespace Config',
111-
'use CodeIgniter\\Config\\BaseConfig;' => 'CodeIgniter\\Shield\\Config\\Auth as ShieldAuth;',
111+
'use CodeIgniter\\Config\\BaseConfig;' => 'use CodeIgniter\\Shield\\Config\\Auth as ShieldAuth;',
112112
'extends BaseConfig' => 'extends ShieldAuth',
113113
];
114114

@@ -120,7 +120,7 @@ private function publishConfigAuthGroups(): void
120120
$file = 'Config/AuthGroups.php';
121121
$replaces = [
122122
'namespace CodeIgniter\Shield\Config' => 'namespace Config',
123-
'use CodeIgniter\\Config\\BaseConfig;' => 'CodeIgniter\\Shield\\Config\\AuthGroups as ShieldAuthGroups;',
123+
'use CodeIgniter\\Config\\BaseConfig;' => 'use CodeIgniter\\Shield\\Config\\AuthGroups as ShieldAuthGroups;',
124124
'extends BaseConfig' => 'extends ShieldAuthGroups',
125125
];
126126

tests/Commands/SetupTest.php

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -53,6 +53,7 @@ public function testRun(): void
5353

5454
$auth = file_get_contents($appFolder . 'Config/Auth.php');
5555
$this->assertStringContainsString('namespace Config;', $auth);
56+
$this->assertStringContainsString('use CodeIgniter\Shield\Config\Auth as ShieldAuth;', $auth);
5657

5758
$routes = file_get_contents($appFolder . 'Config/Routes.php');
5859
$this->assertStringContainsString('service(\'auth\')->routes($routes);', $routes);

0 commit comments

Comments
 (0)