Skip to content

Commit

Permalink
Resolved code review feedback
Browse files Browse the repository at this point in the history
  • Loading branch information
DumitracheAdrian committed Apr 18, 2024
1 parent 85c2c32 commit 5e6e55c
Show file tree
Hide file tree
Showing 6 changed files with 5 additions and 21 deletions.
4 changes: 2 additions & 2 deletions packages/cron-job/Tests/CronJobProcessorTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -222,8 +222,8 @@ public function testProcessWithError(): void
$this->cronJobProcessor->process($execution);

static::assertNotNull($execution->getExecutionStartedAt());
static::assertNull($execution->getExecutionEndedAt());
static::assertNull($execution->getExecutionDelay());
static::assertNotNull($execution->getExecutionEndedAt());
static::assertNotNull($execution->getExecutionDelay());
static::assertEquals($exitCode, $execution->getExitCode());
static::assertNotNull($execution->getError());
}
Expand Down

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@
use Draw\Bundle\SonataExtraBundle\Configuration\SonataAdminNodeConfiguration;
use Draw\Bundle\SonataIntegrationBundle\Console\Controller\ExecutionController;
use Draw\Bundle\SonataIntegrationBundle\CronJob\Controller\CronJobController;
use Draw\Bundle\SonataIntegrationBundle\CronJob\Controller\CronJobExecutionController;
use Draw\Bundle\SonataIntegrationBundle\User\Extension\TwoFactorAuthenticationExtension;
use Draw\Bundle\UserBundle\DrawUserBundle;
use Draw\Bundle\UserBundle\Entity\UserLock;
Expand Down Expand Up @@ -107,7 +106,6 @@ private function createCronJobNode(): ArrayNodeDefinition
(new SonataAdminNodeConfiguration(CronJobExecution::class, 'Cron Job', 'cron_job_execution'))
->addDefaultsIfNotSet()
->pagerTypeDefaultValue('simple')
->controllerClassDefaultValue(CronJobExecutionController::class)
->labelDefaultValue('Cron Job Execution')
)
->end()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -135,9 +135,9 @@ private function configureCronJob(array $config, Loader\FileLoader $loader, Cont
)
->setAutowired(true)
->setAutoconfigured(true);

$this->setControllerClassDefinition($config['admin'][$adminId], $container);
}

$this->setControllerClassDefinition($config['admin']['cron_job'], $container);
}

private function configureMessenger(array $config, Loader\FileLoader $loader, ContainerBuilder $container): void
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@
use App\Sonata\Admin\UserAdmin;
use Draw\Bundle\SonataIntegrationBundle\Console\Controller\ExecutionController;
use Draw\Bundle\SonataIntegrationBundle\CronJob\Controller\CronJobController;
use Draw\Bundle\SonataIntegrationBundle\CronJob\Controller\CronJobExecutionController;
use Draw\Bundle\SonataIntegrationBundle\DependencyInjection\Configuration;
use Draw\Bundle\SonataIntegrationBundle\User\Extension\TwoFactorAuthenticationExtension;
use Draw\Bundle\UserBundle\Entity\UserLock;
Expand Down Expand Up @@ -72,7 +71,7 @@ public function getDefaultConfiguration(): array
'cron_job_execution' => [
'group' => 'Cron Job',
'entity_class' => CronJobExecution::class,
'controller_class' => CronJobExecutionController::class,
'controller_class' => 'sonata.admin.controller.crud',
'icon' => null,
'label' => 'Cron Job Execution',
'pager_type' => 'simple',
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@
use Draw\Bundle\SonataIntegrationBundle\CronJob\Admin\CronJobAdmin;
use Draw\Bundle\SonataIntegrationBundle\CronJob\Admin\CronJobExecutionAdmin;
use Draw\Bundle\SonataIntegrationBundle\CronJob\Controller\CronJobController;
use Draw\Bundle\SonataIntegrationBundle\CronJob\Controller\CronJobExecutionController;
use Draw\Bundle\SonataIntegrationBundle\DependencyInjection\DrawSonataIntegrationExtension;
use Draw\Bundle\SonataIntegrationBundle\Tests\DependencyInjection\DrawSonataIntegrationExtensionTest;
use PHPUnit\Framework\Attributes\CoversClass;
Expand All @@ -31,6 +30,5 @@ public static function provideTestHasServiceDefinition(): iterable
yield [CronJobAdmin::class];
yield [CronJobExecutionAdmin::class];
yield [CronJobController::class];
yield [CronJobExecutionController::class];
}
}

0 comments on commit 5e6e55c

Please sign in to comment.