|
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); |
|
|
|
|
|
|
52
|
|
|
$this->assertRegexp("/fontawesome-.*\.zip/", $output); |
|
|
|
|
|
|
53
|
|
|
$this->assertRegexp("/jquery-.*\.zip/", $output); |
|
|
|
|
|
|
54
|
|
|
$this->assertRegexp("/jquery-easyautocomplete-.*\.zip/", $output); |
|
|
|
|
|
|
55
|
|
|
$this->assertRegexp("/jquery-inputmask-.*\.zip/", $output); |
|
|
|
|
|
|
56
|
|
|
$this->assertRegexp("/jquery-select2-.*\.zip/", $output); |
|
|
|
|
|
|
57
|
|
|
$this->assertRegexp("/material-design-color-palette-.*\.zip/", $output); |
|
|
|
|
|
|
58
|
|
|
$this->assertRegexp("/material-design-hierarchical-display-.*\.zip/", $output); |
|
|
|
|
|
|
59
|
|
|
$this->assertRegexp("/material-design-iconic-font-.*\.zip/", $output); |
|
|
|
|
|
|
60
|
|
|
$this->assertRegexp("/meteocons\.zip/", $output); |
|
|
|
|
|
|
61
|
|
|
$this->assertRegexp("/sweetalert-.*\.zip/", $output); |
|
|
|
|
|
|
62
|
|
|
$this->assertRegexp("/waitme-.*\.zip/", $output); |
|
|
|
|
|
|
63
|
|
|
$this->assertStringContainsString("[OK] All assets were successfully unzipped", $output); |
|
64
|
|
|
} |
|
65
|
|
|
} |
|
66
|
|
|
|
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.