mirror of
https://github.com/alchemy-fr/Phraseanet.git
synced 2025-10-17 06:53:15 +00:00
Fix & enhance unit tests
This commit is contained in:

committed by
Romain Neutron

parent
5fbb2e83b2
commit
18b79e6f1a
@@ -442,12 +442,22 @@ class LazaretTest extends \PhraseanetWebTestCaseAuthenticatedAbstract
|
||||
$em->expects($this->once())
|
||||
->method('flush');
|
||||
|
||||
$called = false;
|
||||
$phpunit = $this;
|
||||
self::$DI['app']['phraseanet.logger'] = self::$DI['app']->protect(function () use (&$called, $phpunit) {
|
||||
$called = true;
|
||||
return $phpunit->getMockBuilder('\Session_Logger')
|
||||
->disableOriginalConstructor()
|
||||
->getMock();
|
||||
});
|
||||
|
||||
self::$DI['app']['EM'] = $em;
|
||||
self::$DI['client'] = new Client(self::$DI['app'], array());
|
||||
|
||||
self::$DI['client']->request('POST', '/prod/lazaret/' . $id . '/accept/', array(
|
||||
'record_id' => self::$DI['record_1']->get_record_id()
|
||||
));
|
||||
$this->assertTrue($called);
|
||||
|
||||
$response = self::$DI['client']->getResponse();
|
||||
|
||||
|
@@ -4,6 +4,7 @@ namespace Alchemy\Tests\Phrasea\Controller\Prod;
|
||||
|
||||
use Alchemy\Phrasea\Application;
|
||||
use Alchemy\Phrasea\Border\Manager;
|
||||
use DataURI;
|
||||
use Symfony\Component\HttpFoundation\File\UploadedFile;
|
||||
use Symfony\Component\HttpFoundation\Response;
|
||||
|
||||
@@ -76,8 +77,10 @@ class UploadTest extends \PhraseanetWebTestCaseAuthenticatedAbstract
|
||||
->disableOriginalConstructor()
|
||||
->getMock();
|
||||
|
||||
$data = DataUri\Data::buildFromFile(__DIR__ . '/../../../../../files/cestlafete.jpg');
|
||||
$params = array(
|
||||
'base_id' => self::$DI['collection']->get_base_id()
|
||||
'base_id' => self::$DI['collection']->get_base_id(),
|
||||
'b64_image' => DataUri\Dumper::dump($data)
|
||||
);
|
||||
|
||||
$files = array(
|
||||
|
Reference in New Issue
Block a user