Skip to content

Testing helpers #241

@repl6669

Description

@repl6669

The dream

Flow outline (we will make a podcast)

  • Prepare notes
  • Record the audio
  • Generate subtitles
  • Publish to Spotify
  • Publish to Youtube
  • Create blog post
  • Send Spotify link to your mom
// Initialize step with dummy data (also initializes filled ancestor steps)
$step = GenerateSubtitlesForEpisode::factory()->withHistory()->create([
    RecordEpisode::class => [
        'publish_to_spotify' => true,
        'publish_to_youtube' => false,
        'create_blog_post' => true,
    ]
]);

$step->finish();

$this->assertStepInitialized($step, PublishEpisodeToSpotify::class); // true
$this->assertStepNotInitialized($step, PublishEpisodeToYoutube::class); // true
$this->assertStepInitialized($step, CreateBlogPostForEpisode::class); // true

$publishToSpotify = $step->getDescendant(PublishEpisodeToSpotify::class); // gets the step

$publishToSpotify->finish([
    'title' => 'Worst open source projects featuring Flow',
    'description' => 'Told ya.'
]);

$step->assertModelHasData([
    'title' => 'Worst open source projects featuring Flow',
    'description' => 'Told ya.'
]); // true

$step->assertStepInitialized(SebdSpotifyLinkToMom::class); // true
$step->assertFinished(); // true

// ... You get the idea

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions