Skip to content

Commit

Permalink
Fix test errors on CakePHP 5.1
Browse files Browse the repository at this point in the history
  • Loading branch information
ADmad committed Nov 16, 2024
1 parent a812fc6 commit f52813b
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 13 deletions.
1 change: 0 additions & 1 deletion tests/TestCase/Bake/BakeTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,6 @@ public function setUp(): void
$this->_compareBasePath = Plugin::path('BootstrapUI') . 'tests' . DS . 'comparisons' . DS . 'Template' . DS;

$this->loadPlugins([
'Bake',
'Cake/TwigView' => [
'bootstrap' => true,
],
Expand Down
4 changes: 1 addition & 3 deletions tests/TestCase/Command/CopyLayoutsCommandTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -118,14 +118,12 @@ public function testFilesCannotBeCopied()
->method('_copyLayouts')
->willReturn(false);

$args = new Arguments([], [], []);

$out = new StubConsoleOutput();
$err = new StubConsoleOutput();
$io = new ConsoleIo($out, $err);

try {
$result = $command->execute($args, $io);
$result = $command->run([], $io);
} catch (StopException $exception) {
$result = $exception->getCode();
}
Expand Down
12 changes: 3 additions & 9 deletions tests/TestCase/Command/ModifyViewCommandTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -118,14 +118,12 @@ public function testPathIsNotAFile()
->method('_isFile')
->willReturn(false);

$args = new Arguments([], [], []);

$out = new StubConsoleOutput();
$err = new StubConsoleOutput();
$io = new ConsoleIo($out, $err);

try {
$result = $command->execute($args, $io);
$result = $command->run([], $io);
} catch (StopException $exception) {
$result = $exception->getCode();
}
Expand Down Expand Up @@ -156,14 +154,12 @@ public function testFileCannotBeRead()
->method('_readFile')
->willReturn(false);

$args = new Arguments([], [], []);

$out = new StubConsoleOutput();
$err = new StubConsoleOutput();
$io = new ConsoleIo($out, $err);

try {
$result = $command->execute($args, $io);
$result = $command->run([], $io);
} catch (StopException $exception) {
$result = $exception->getCode();
}
Expand Down Expand Up @@ -194,14 +190,12 @@ public function testFileCannotBeWritten()
->method('_writeFile')
->willReturn(false);

$args = new Arguments([], [], []);

$out = new StubConsoleOutput();
$err = new StubConsoleOutput();
$io = new ConsoleIo($out, $err);

try {
$result = $command->execute($args, $io);
$result = $command->run([], $io);
} catch (StopException $exception) {
$result = $exception->getCode();
}
Expand Down

0 comments on commit f52813b

Please sign in to comment.