Skip to content

Commit

Permalink
MNT Fix unit tests
Browse files Browse the repository at this point in the history
  • Loading branch information
GuySartorelli committed Sep 30, 2024
1 parent c10b2d0 commit f6f1244
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 8 deletions.
8 changes: 4 additions & 4 deletions tests/php/Model/LocalDateTimeTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -88,19 +88,19 @@ public static function provideTestSwitchLocales()
return [
[
'locale' => 'en_NZ',
'localTIme' => '2021-01-13 02:00:12',
'expectedTime' => '2021-01-13 02:00:12',
],
[
'locale' => 'en_AU',
'localTime' => '2021-01-12 23:00:12',
'expectedTime' => '2021-01-12 23:00:12',
],
[
'locale' => 'es_ES',
'localTime' => '2021-01-12 14:00:12',
'expectedTime' => '2021-01-12 14:00:12',
],
[
'locale' => 'es_US',
'localTime' => '2021-01-12 08:00:12',
'expectedTime' => '2021-01-12 08:00:12',
],
];
}
Expand Down
10 changes: 6 additions & 4 deletions tests/php/Task/InitialPageLocalisationTaskTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@
use TractorCow\Fluent\State\FluentState;
use TractorCow\Fluent\Task\InitialPageLocalisationTask;
use PHPUnit\Framework\Attributes\DataProvider;
use Symfony\Component\Console\Input\InputDefinition;

class InitialPageLocalisationTaskTest extends SapphireTest
{
Expand Down Expand Up @@ -69,17 +70,18 @@ public function testInitialPageLocalisation(bool $publish, int $limit, array $lo
$pages = $this->getLocalisedPages();
$this->assertCount(0, $pages);

$getParams = [
'publish' => $publish,
'limit' => $limit,
$options = [
'--publish' => $publish,
'--limit' => $limit,
];

// Localise pages
$task = InitialPageLocalisationTask::singleton();
$buffer = new BufferedOutput();
$output = new PolyOutput(PolyOutput::FORMAT_ANSI, wrappedOutput: $buffer);
$input = new ArrayInput($getParams);
$input = new ArrayInput($options);
$input->setInteractive(false);
$input->bind(new InputDefinition($task->getOptions()));
$task->run($input, $output);

// Check localised records (should have all pages now)
Expand Down

0 comments on commit f6f1244

Please sign in to comment.