1
0
mirror of https://github.com/ToxicCrack/PrintABrick.git synced 2025-05-17 21:00:09 -07:00
2017-06-23 22:21:09 +02:00

46 lines
1.3 KiB
PHP

<?php
namespace Tests\LoaderBundle\Service;
use AppBundle\DataFixtures\ORM\LoadColors;
use AppBundle\Entity\Rebrickable\Set;
use LoaderBundle\Service\RebrickableLoader;
use Tests\AppBundle\BaseTest;
class RebrickableLoaderTest extends BaseTest
{
/**
* @var RebrickableLoader
*/
private $rebrickableLoader;
public function setUp()
{
parent::setUp();
$this->setUpDb([LoadColors::class]);
$this->rebrickableLoader = new RebrickableLoader($this->em, $this->get('monolog.logger.event'), __DIR__.'/fixtures/');
}
public function testLoadAll()
{
$this->assertCount(0, $this->em->getRepository(Set::class)->findAll());
$this->rebrickableLoader->loadAll();
$this->assertCount(1, $this->em->getRepository(Set::class)->findAll());
}
// /**
// * @expectedException LoaderBundle\Exception\Loader\LoadingRebrickableFailedException
// */
// public function testRollback() {
// $this->rebrickableLoader = new RebrickableLoader($this->em,$this->get('monolog.logger.event'),__DIR__.'/corrupt/');
//
// $this->assertCount(0,$this->em->getRepository(Set::class)->findAll());
//
// $this->rebrickableLoader->loadAll();
//
// $this->assertCount(0,$this->em->getRepository(Set::class)->findAll());
// }
}