Skip to content

Commit 2c839d2

Browse files
committed
fix: set Test of namespace
1 parent 61bffc2 commit 2c839d2

File tree

1 file changed

+6
-5
lines changed

1 file changed

+6
-5
lines changed

tests/Commands/UserModelGeneratorTest.php

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,7 @@ protected function getFileContents(string $filepath): string
4747
public function testGenerateUserModel(): void
4848
{
4949
command('shield:model MyUserModel');
50-
$filepath = APPPATH . 'Models\MyUserModel.php';
50+
$filepath = APPPATH . 'Models/MyUserModel.php';
5151

5252
$this->assertStringContainsString('File created: ', CITestStreamFilter::$buffer);
5353
$this->assertFileExists($filepath);
@@ -60,13 +60,14 @@ public function testGenerateUserModel(): void
6060

6161
public function testGenerateUserModelCustomNamespace(): void
6262
{
63-
command('shield:model MyUserModel --namespace CodeIgniter\\\\Shield');
64-
$filepath = VENDORPATH . 'codeigniter4/shield/src/Models/MyUserModel.php';
63+
command('shield:model MyUserModel --namespace Tests');
64+
$filepath = Tests . 'MyUserModel.php';
65+
6566

6667
$this->assertStringContainsString('File created: ', CITestStreamFilter::$buffer);
6768
$this->assertFileExists($filepath);
6869

69-
$this->assertStringContainsString('namespace CodeIgniter\Shield\Models;', $this->getFileContents($filepath));
70+
$this->assertStringContainsString('namespace Tests;', $this->getFileContents($filepath));
7071
$this->assertStringContainsString('class MyUserModel extends UserModel', $this->getFileContents($filepath));
7172
$this->assertStringContainsString('use CodeIgniter\Shield\Models\UserModel;', $this->getFileContents($filepath));
7273
$this->assertStringContainsString('protected function initialize(): void', $this->getFileContents($filepath));
@@ -92,7 +93,7 @@ public function testGenerateUserModelWithForce(): void
9293
public function testGenerateUserModelWithSuffix(): void
9394
{
9495
command('shield:model MyUser --suffix');
95-
$filepath = APPPATH . 'Models\MyUserModel.php';
96+
$filepath = APPPATH . 'Models/MyUserModel.php';
9697

9798
$this->assertStringContainsString('File created: ', CITestStreamFilter::$buffer);
9899
$this->assertFileExists($filepath);

0 commit comments

Comments
 (0)