Skip to content

Commit

Permalink
feat: add steps
Browse files Browse the repository at this point in the history
  • Loading branch information
rgomezcasas committed Dec 20, 2023
1 parent 46af271 commit b14966a
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 6 deletions.
4 changes: 2 additions & 2 deletions .env
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,8 @@ APP_SECRET=29ac4a5187930cd4b689aa0f3ee7cbc0
#--------------------------------#
# MySql
MOOC_DATABASE_DRIVER=pdo_mysql
MOOC_DATABASE_HOST=127.0.0.1
MOOC_DATABASE_PORT=3360
MOOC_DATABASE_HOST=codely-php_ddd_skeleton-mooc-mysql
MOOC_DATABASE_PORT=3306
MOOC_DATABASE_NAME=mooc
MOOC_DATABASE_USER=root
MOOC_DATABASE_PASSWORD=
Expand Down
5 changes: 3 additions & 2 deletions tests/Mooc/Steps/Domain/Quiz/QuizStepMother.php
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,6 @@
use CodelyTv\Tests\Mooc\Steps\Domain\StepIdMother;
use CodelyTv\Tests\Mooc\Steps\Domain\StepTitleMother;
use CodelyTv\Tests\Shared\Domain\Repeater;
use CodelyTv\Tests\Shared\Domain\WordMother;

final class QuizStepMother
{
Expand All @@ -23,7 +22,9 @@ public static function create(
?StepDuration $duration = null,
QuizStepQuestion ...$questions
): QuizStep {
$stepQuestions = $questions ?? Repeater::random(fn (): string => WordMother::create());
$stepQuestions = count($questions) === 0 ? Repeater::random(
fn (): QuizStepQuestion => QuizStepQuestionMother::create()
) : $questions;

return new QuizStep(
$id ?? StepIdMother::create(),
Expand Down
3 changes: 1 addition & 2 deletions tests/Mooc/Steps/Domain/Quiz/QuizStepQuestionMother.php
Original file line number Diff line number Diff line change
Expand Up @@ -5,13 +5,12 @@
namespace CodelyTv\Tests\Mooc\Steps\Domain\Quiz;

use CodelyTv\Mooc\Steps\Domain\Quiz\QuizStepQuestion;
use CodelyTv\Mooc\Steps\Domain\Video\VideoStepUrl;
use CodelyTv\Tests\Shared\Domain\Repeater;
use CodelyTv\Tests\Shared\Domain\WordMother;

final class QuizStepQuestionMother
{
public static function create(?string $question = null, array $answers = []): VideoStepUrl
public static function create(?string $question = null, array $answers = []): QuizStepQuestion
{
return new QuizStepQuestion(
$question ?? WordMother::create(),
Expand Down

0 comments on commit b14966a

Please sign in to comment.