// 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
The dream
Flow outline (we will make a podcast)