Skip to content

Commit

Permalink
Adds test cases for generating a test file using an artisan command
Browse files Browse the repository at this point in the history
  • Loading branch information
craigpaul committed Nov 26, 2023
1 parent 08feb19 commit deb4bb3
Showing 1 changed file with 20 additions and 0 deletions.
20 changes: 20 additions & 0 deletions tests/CanAddStubbedTestFileViaCommandTest.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
<?php

namespace CraigPaul\Blitz\Tests;

class CanAddStubbedTestFileViaCommandTest extends TestCase
{
public function testCanAddStubbedTestFileWhenSupplyingTestNameSuccessfully()
{
$this->artisan('blitz:make ExampleLoadTest')->assertOk();

$this->assertFileExists($this->app->basePath('tests/Blitz/ExampleLoadTest.php'));
}

public function testCanAddStubbedTestFileWhenAskedForTestNameSuccessfully()
{
$this->artisan('blitz:make')->expectsQuestion('What should the test be named?', 'AnotherExampleLoadTest')->assertOk();

$this->assertFileExists($this->app->basePath('tests/Blitz/AnotherExampleLoadTest.php'));
}
}

0 comments on commit deb4bb3

Please sign in to comment.