| Conditions | 1 |
| Paths | 1 |
| Total Lines | 66 |
| Code Lines | 50 |
| Lines | 0 |
| Ratio | 0 % |
| Changes | 1 | ||
| Bugs | 0 | Features | 0 |
Small methods make your code easier to understand, in particular if combined with a good name. Besides, if your method is small, finding a good name is usually much easier.
For example, if you find yourself adding comments to a method's body, this is usually a good sign to extract the commented part to a new method, and use the comment as a starting point when coming up with a good name for this new method.
Commonly applied refactorings include:
If many parameters/temporary variables are present:
| 1 | <?php |
||
| 18 | public function testExecute() |
||
| 19 | { |
||
| 20 | $application = new Application(); |
||
| 21 | $application->add(new InstallCommand()); |
||
| 22 | |||
| 23 | $command = $application->find('install'); |
||
| 24 | $commandTester = new CommandTester($command); |
||
| 25 | $commandTester->execute([ |
||
| 26 | 'command' => $command->getName(). |
||
| 27 | '--force' |
||
| 28 | ]); |
||
| 29 | |||
| 30 | $this->assertTrue( |
||
| 31 | $this->fileHasContent('/composer.json','acacha/admin-lte-template-laravel')); |
||
| 32 | |||
| 33 | $this->assertTrue( |
||
| 34 | $this->fileHasContent( |
||
| 35 | '/config/app.php', |
||
| 36 | 'Acacha\AdminLTETemplateLaravel\Providers\AdminLTETemplateServiceProvider::class' |
||
| 37 | )); |
||
| 38 | |||
| 39 | $this->assertTrue( |
||
| 40 | $this->fileHasContent( |
||
| 41 | '/config/app.php', |
||
| 42 | 'Acacha\AdminLTETemplateLaravel\Facades\AdminLTE::class' |
||
| 43 | )); |
||
| 44 | |||
| 45 | $this->assertFileExists('app/Http/Controllers/HomeController.php'); |
||
| 46 | |||
| 47 | $this->assertTrue( |
||
| 48 | $this->fileHasContent( |
||
| 49 | '/app/Http/Controllers/Auth/RegisterController.php', |
||
| 50 | "'terms' => 'required'," |
||
| 51 | )); |
||
| 52 | |||
| 53 | $this->assertFileExists('public/img'); |
||
| 54 | $this->assertFileExists('public/img/AcachaAdminLTE.png'); |
||
| 55 | $this->assertFileExists('public/css/AdminLTE.css'); |
||
| 56 | $this->assertFileExists('public/js/adminlte-app.js'); |
||
| 57 | $this->assertFileExists('public/plugins'); |
||
| 58 | $this->assertFileExists('public/fonts'); |
||
| 59 | $this->assertFileExists('resources/views/auth'); |
||
| 60 | $this->assertFileExists('resources/views/auth/emails'); |
||
| 61 | $this->assertFileExists('resources/views/errors/404.blade.php'); |
||
| 62 | $this->assertFileExists('resources/views/layouts'); |
||
| 63 | $this->assertFileExists('resources/views/home.blade.php'); |
||
| 64 | $this->assertTrue( |
||
| 65 | $this->fileHasContent( |
||
| 66 | '/resources/views/welcome.blade.php', |
||
| 67 | "extends('layouts.landing')" |
||
| 68 | )); |
||
| 69 | $this->assertFileExists('resources/assets/less'); |
||
| 70 | $this->assertTrue( |
||
| 71 | $this->fileHasContent( |
||
| 72 | '/gulpfile.js', |
||
| 73 | "mix.less('admin-lte/AdminLTE.less');" |
||
| 74 | )); |
||
| 75 | $this->assertFileExists('tests/AcachaAdminLTELaravelTest.php'); |
||
| 76 | $this->assertTrue( |
||
| 77 | $this->fileHasContent( |
||
| 78 | '/phpunit.xml', |
||
| 79 | "sqlite" |
||
| 80 | )); |
||
| 81 | $this->assertFileExists('resources/lang/vendor/adminlte_lang'); |
||
| 82 | $this->assertFileExists('config/gravatar.php'); |
||
| 83 | } |
||
| 84 | |||
| 96 | } |