1
0
mirror of https://github.com/ToxicCrack/PrintABrick.git synced 2025-05-15 20:00:08 -07:00
PrintABrick/tests/LoaderBundle/Command/loadImagesCommandTest.php
2017-06-24 11:46:46 +02:00

40 lines
1.1 KiB
PHP

<?php
namespace Tests\LoaderBundle\Command;
use LoaderBundle\Command\LoadImagesCommand;
use LoaderBundle\Command\LoadLdrawCommand;
use LoaderBundle\Service\ImageLoader;
use LoaderBundle\Service\ModelLoader;
use Symfony\Bundle\FrameworkBundle\Console\Application;
use Symfony\Bundle\FrameworkBundle\Test\KernelTestCase;
use Symfony\Component\Console\Tester\CommandTester;
class loadImagesCommandTest extends KernelTestCase
{
public function testLoadRebrickable()
{
self::bootKernel();
$application = new Application(self::$kernel);
$imageLoader = $this->createMock(ImageLoader::class);
$imageLoader->expects($this->once())->method('loadColorFromRebrickable')->with(-1);
$imageLoader->expects($this->once())->method('loadMissingModelImages');
$application->add(new LoadImagesCommand(null,$imageLoader));
$command = $application->find('app:load:images');
$tester = new CommandTester($command);
$tester->execute(
[
'--rebrickable' => true,
'--color' => -1,
'--missing' => true
]
);
}
}