UnzipAssetsCommandWebTest::testExecute()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 32
Code Lines 22

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
eloc 22
dl 0
loc 32
rs 9.568
c 0
b 0
f 0
cc 1
nc 1
nop 0
1
<?php
2
3
/*
4
 * This file is part of the core-bundle package.
5
 *
6
 * (c) 2018 WEBEWEB
7
 *
8
 * For the full copyright and license information, please view the LICENSE
9
 * file that was distributed with this source code.
10
 */
11
12
namespace WBW\Bundle\CoreBundle\Tests\Command;
13
14
use Symfony\Bundle\FrameworkBundle\Console\Application;
15
use Symfony\Component\Console\Tester\CommandTester;
16
use WBW\Bundle\CoreBundle\Command\UnzipAssetsCommand;
17
use WBW\Bundle\CoreBundle\Tests\AbstractWebTestCase;
18
19
/**
20
 * Unzip assets command test.
21
 *
22
 * @author webeweb <https://github.com/webeweb>
23
 * @package WBW\Bundle\CoreBundle\Tests\Command
24
 */
25
class UnzipAssetsCommandWebTest extends AbstractWebTestCase {
26
27
    /**
28
     * Test execute()
29
     *
30
     * @return void
31
     */
32
    public function testExecute(): void {
33
34
        // Set an Application mock.
35
        $application = new Application(static::$kernel);
36
        $application->add(new UnzipAssetsCommand());
37
38
        // Set a Command mock.
39
        $command = $application->find("wbw:core:unzip-assets");
40
41
        // Set a Command tester.
42
        $commandTester = new CommandTester($command);
43
44
        $res = $commandTester->execute([
45
            "command" => $command->getName(),
46
        ]);
47
        $this->assertEquals(0, $res);
48
49
        $output = $commandTester->getDisplay();
50
        $this->assertStringContainsString("Trying to unzip assets", $output);
51
        $this->assertRegexp("/animate\.css-.*\.zip/", $output);
0 ignored issues
show
Deprecated Code introduced by
The function PHPUnit\Framework\Assert::assertRegExp() has been deprecated: https://github.com/sebastianbergmann/phpunit/issues/4086 ( Ignorable by Annotation )

If this is a false-positive, you can also ignore this issue in your code via the ignore-deprecated  annotation

51
        /** @scrutinizer ignore-deprecated */ $this->assertRegexp("/animate\.css-.*\.zip/", $output);

This function has been deprecated. The supplier of the function has supplied an explanatory message.

The explanatory message should give you some clue as to whether and when the function will be removed and what other function to use instead.

Loading history...
52
        $this->assertRegexp("/fontawesome-.*\.zip/", $output);
0 ignored issues
show
Deprecated Code introduced by
The function PHPUnit\Framework\Assert::assertRegExp() has been deprecated: https://github.com/sebastianbergmann/phpunit/issues/4086 ( Ignorable by Annotation )

If this is a false-positive, you can also ignore this issue in your code via the ignore-deprecated  annotation

52
        /** @scrutinizer ignore-deprecated */ $this->assertRegexp("/fontawesome-.*\.zip/", $output);

This function has been deprecated. The supplier of the function has supplied an explanatory message.

The explanatory message should give you some clue as to whether and when the function will be removed and what other function to use instead.

Loading history...
53
        $this->assertRegexp("/jquery-.*\.zip/", $output);
0 ignored issues
show
Deprecated Code introduced by
The function PHPUnit\Framework\Assert::assertRegExp() has been deprecated: https://github.com/sebastianbergmann/phpunit/issues/4086 ( Ignorable by Annotation )

If this is a false-positive, you can also ignore this issue in your code via the ignore-deprecated  annotation

53
        /** @scrutinizer ignore-deprecated */ $this->assertRegexp("/jquery-.*\.zip/", $output);

This function has been deprecated. The supplier of the function has supplied an explanatory message.

The explanatory message should give you some clue as to whether and when the function will be removed and what other function to use instead.

Loading history...
54
        $this->assertRegexp("/jquery-easyautocomplete-.*\.zip/", $output);
0 ignored issues
show
Deprecated Code introduced by
The function PHPUnit\Framework\Assert::assertRegExp() has been deprecated: https://github.com/sebastianbergmann/phpunit/issues/4086 ( Ignorable by Annotation )

If this is a false-positive, you can also ignore this issue in your code via the ignore-deprecated  annotation

54
        /** @scrutinizer ignore-deprecated */ $this->assertRegexp("/jquery-easyautocomplete-.*\.zip/", $output);

This function has been deprecated. The supplier of the function has supplied an explanatory message.

The explanatory message should give you some clue as to whether and when the function will be removed and what other function to use instead.

Loading history...
55
        $this->assertRegexp("/jquery-inputmask-.*\.zip/", $output);
0 ignored issues
show
Deprecated Code introduced by
The function PHPUnit\Framework\Assert::assertRegExp() has been deprecated: https://github.com/sebastianbergmann/phpunit/issues/4086 ( Ignorable by Annotation )

If this is a false-positive, you can also ignore this issue in your code via the ignore-deprecated  annotation

55
        /** @scrutinizer ignore-deprecated */ $this->assertRegexp("/jquery-inputmask-.*\.zip/", $output);

This function has been deprecated. The supplier of the function has supplied an explanatory message.

The explanatory message should give you some clue as to whether and when the function will be removed and what other function to use instead.

Loading history...
56
        $this->assertRegexp("/jquery-select2-.*\.zip/", $output);
0 ignored issues
show
Deprecated Code introduced by
The function PHPUnit\Framework\Assert::assertRegExp() has been deprecated: https://github.com/sebastianbergmann/phpunit/issues/4086 ( Ignorable by Annotation )

If this is a false-positive, you can also ignore this issue in your code via the ignore-deprecated  annotation

56
        /** @scrutinizer ignore-deprecated */ $this->assertRegexp("/jquery-select2-.*\.zip/", $output);

This function has been deprecated. The supplier of the function has supplied an explanatory message.

The explanatory message should give you some clue as to whether and when the function will be removed and what other function to use instead.

Loading history...
57
        $this->assertRegexp("/material-design-color-palette-.*\.zip/", $output);
0 ignored issues
show
Deprecated Code introduced by
The function PHPUnit\Framework\Assert::assertRegExp() has been deprecated: https://github.com/sebastianbergmann/phpunit/issues/4086 ( Ignorable by Annotation )

If this is a false-positive, you can also ignore this issue in your code via the ignore-deprecated  annotation

57
        /** @scrutinizer ignore-deprecated */ $this->assertRegexp("/material-design-color-palette-.*\.zip/", $output);

This function has been deprecated. The supplier of the function has supplied an explanatory message.

The explanatory message should give you some clue as to whether and when the function will be removed and what other function to use instead.

Loading history...
58
        $this->assertRegexp("/material-design-hierarchical-display-.*\.zip/", $output);
0 ignored issues
show
Deprecated Code introduced by
The function PHPUnit\Framework\Assert::assertRegExp() has been deprecated: https://github.com/sebastianbergmann/phpunit/issues/4086 ( Ignorable by Annotation )

If this is a false-positive, you can also ignore this issue in your code via the ignore-deprecated  annotation

58
        /** @scrutinizer ignore-deprecated */ $this->assertRegexp("/material-design-hierarchical-display-.*\.zip/", $output);

This function has been deprecated. The supplier of the function has supplied an explanatory message.

The explanatory message should give you some clue as to whether and when the function will be removed and what other function to use instead.

Loading history...
59
        $this->assertRegexp("/material-design-iconic-font-.*\.zip/", $output);
0 ignored issues
show
Deprecated Code introduced by
The function PHPUnit\Framework\Assert::assertRegExp() has been deprecated: https://github.com/sebastianbergmann/phpunit/issues/4086 ( Ignorable by Annotation )

If this is a false-positive, you can also ignore this issue in your code via the ignore-deprecated  annotation

59
        /** @scrutinizer ignore-deprecated */ $this->assertRegexp("/material-design-iconic-font-.*\.zip/", $output);

This function has been deprecated. The supplier of the function has supplied an explanatory message.

The explanatory message should give you some clue as to whether and when the function will be removed and what other function to use instead.

Loading history...
60
        $this->assertRegexp("/meteocons\.zip/", $output);
0 ignored issues
show
Deprecated Code introduced by
The function PHPUnit\Framework\Assert::assertRegExp() has been deprecated: https://github.com/sebastianbergmann/phpunit/issues/4086 ( Ignorable by Annotation )

If this is a false-positive, you can also ignore this issue in your code via the ignore-deprecated  annotation

60
        /** @scrutinizer ignore-deprecated */ $this->assertRegexp("/meteocons\.zip/", $output);

This function has been deprecated. The supplier of the function has supplied an explanatory message.

The explanatory message should give you some clue as to whether and when the function will be removed and what other function to use instead.

Loading history...
61
        $this->assertRegexp("/sweetalert-.*\.zip/", $output);
0 ignored issues
show
Deprecated Code introduced by
The function PHPUnit\Framework\Assert::assertRegExp() has been deprecated: https://github.com/sebastianbergmann/phpunit/issues/4086 ( Ignorable by Annotation )

If this is a false-positive, you can also ignore this issue in your code via the ignore-deprecated  annotation

61
        /** @scrutinizer ignore-deprecated */ $this->assertRegexp("/sweetalert-.*\.zip/", $output);

This function has been deprecated. The supplier of the function has supplied an explanatory message.

The explanatory message should give you some clue as to whether and when the function will be removed and what other function to use instead.

Loading history...
62
        $this->assertRegexp("/waitme-.*\.zip/", $output);
0 ignored issues
show
Deprecated Code introduced by
The function PHPUnit\Framework\Assert::assertRegExp() has been deprecated: https://github.com/sebastianbergmann/phpunit/issues/4086 ( Ignorable by Annotation )

If this is a false-positive, you can also ignore this issue in your code via the ignore-deprecated  annotation

62
        /** @scrutinizer ignore-deprecated */ $this->assertRegexp("/waitme-.*\.zip/", $output);

This function has been deprecated. The supplier of the function has supplied an explanatory message.

The explanatory message should give you some clue as to whether and when the function will be removed and what other function to use instead.

Loading history...
63
        $this->assertStringContainsString("[OK] All assets were successfully unzipped", $output);
64
    }
65
}
66