for testing and deploying your application
for finding and fixing issues
for empowering human code reviews
<?php
namespace Nwidart\Modules\Tests;
class ModuleGeneratorTest extends BaseTestCase
{
/**
* @var \Illuminate\Filesystem\Filesystem
*/
private $finder;
* @var string
private $modulePath;
public function setUp()
parent::setUp();
$this->modulePath = base_path('modules/Blog');
$this->finder = $this->app['files'];
}
public function tearDown()
$this->finder->deleteDirectory($this->modulePath);
parent::tearDown();
/** @test */
public function it_generates_module()
$code = $this->artisan('module:make', ['name' => ['Blog']]);
$this->assertTrue(is_dir($this->modulePath));
$this->assertSame(0, $code);
public function it_generates_module_folders()
$this->artisan('module:make', ['name' => ['Blog']]);
foreach (config('modules.paths.generator') as $directory) {
$this->assertTrue(is_dir($this->modulePath . '/' . $directory));
public function it_generates_module_files()
foreach (config('modules.stubs.files') as $file) {
$this->assertTrue(is_file($this->modulePath . '/' . $file));