Conditions | 1 |
Paths | 1 |
Total Lines | 66 |
Code Lines | 50 |
Lines | 0 |
Ratio | 0 % |
Changes | 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 |
||
17 | public function testExecute() |
||
18 | { |
||
19 | $application = new Application(); |
||
20 | $application->add(new InstallCommand()); |
||
21 | |||
22 | $command = $application->find('install'); |
||
23 | $commandTester = new CommandTester($command); |
||
24 | $commandTester->execute([ |
||
25 | 'command' => $command->getName(). |
||
26 | '--force', |
||
27 | ]); |
||
28 | |||
29 | $this->assertTrue( |
||
30 | $this->fileHasContent('/composer.json', 'acacha/admin-lte-template-laravel')); |
||
31 | |||
32 | $this->assertTrue( |
||
33 | $this->fileHasContent( |
||
34 | '/config/app.php', |
||
35 | 'Acacha\AdminLTETemplateLaravel\Providers\AdminLTETemplateServiceProvider::class' |
||
36 | )); |
||
37 | |||
38 | $this->assertTrue( |
||
39 | $this->fileHasContent( |
||
40 | '/config/app.php', |
||
41 | 'Acacha\AdminLTETemplateLaravel\Facades\AdminLTE::class' |
||
42 | )); |
||
43 | |||
44 | $this->assertFileExists('app/Http/Controllers/HomeController.php'); |
||
45 | |||
46 | $this->assertTrue( |
||
47 | $this->fileHasContent( |
||
48 | '/app/Http/Controllers/Auth/RegisterController.php', |
||
49 | "'terms' => 'required'," |
||
50 | )); |
||
51 | |||
52 | $this->assertFileExists('public/img'); |
||
53 | $this->assertFileExists('public/img/AcachaAdminLTE.png'); |
||
54 | $this->assertFileExists('public/css/AdminLTE.css'); |
||
55 | $this->assertFileExists('public/js/adminlte-app.js'); |
||
56 | $this->assertFileExists('public/plugins'); |
||
57 | $this->assertFileExists('public/fonts'); |
||
58 | $this->assertFileExists('resources/views/auth'); |
||
59 | $this->assertFileExists('resources/views/auth/emails'); |
||
60 | $this->assertFileExists('resources/views/errors/404.blade.php'); |
||
61 | $this->assertFileExists('resources/views/layouts'); |
||
62 | $this->assertFileExists('resources/views/home.blade.php'); |
||
63 | $this->assertTrue( |
||
64 | $this->fileHasContent( |
||
65 | '/resources/views/welcome.blade.php', |
||
66 | "extends('layouts.landing')" |
||
67 | )); |
||
68 | $this->assertFileExists('resources/assets/less'); |
||
69 | $this->assertTrue( |
||
70 | $this->fileHasContent( |
||
71 | '/gulpfile.js', |
||
72 | "mix.less('admin-lte/AdminLTE.less');" |
||
73 | )); |
||
74 | $this->assertFileExists('tests/AcachaAdminLTELaravelTest.php'); |
||
75 | $this->assertTrue( |
||
76 | $this->fileHasContent( |
||
77 | '/phpunit.xml', |
||
78 | 'sqlite' |
||
79 | )); |
||
80 | $this->assertFileExists('resources/lang/vendor/adminlte_lang'); |
||
81 | $this->assertFileExists('config/gravatar.php'); |
||
82 | } |
||
83 | |||
97 |