diff --git a/tests/Alchemy/Tests/Phrasea/Controller/Api/ApiJsonTest.php b/tests/Alchemy/Tests/Phrasea/Controller/Api/ApiJsonTest.php index 4fbad594a2..6945e4c151 100644 --- a/tests/Alchemy/Tests/Phrasea/Controller/Api/ApiJsonTest.php +++ b/tests/Alchemy/Tests/Phrasea/Controller/Api/ApiJsonTest.php @@ -903,11 +903,14 @@ class ApiJsonTest extends ApiTestCase ->method('getSuggestions') ->will($this->returnValue(new ArrayCollection())); - self::$DI['app']['phraseanet.SE'] = $this->getMock('Alchemy\Phrasea\SearchEngine\SearchEngineInterface'); + $app = $this->getApplication(); + $mock = $this->getMock('Alchemy\Phrasea\SearchEngine\SearchEngineInterface'); + $app['phraseanet.SE'] = $mock; - self::$DI['app']['phraseanet.SE']->expects($this->once()) + $mock + ->expects($this->once()) ->method('query') - ->with('koala', 0, 10) + ->withAnyParameters() ->will($this->returnValue( $this->getMockBuilder('Alchemy\Phrasea\SearchEngine\SearchEngineResult') ->disableOriginalConstructor() diff --git a/tests/Alchemy/Tests/Phrasea/Controller/Prod/QueryTest.php b/tests/Alchemy/Tests/Phrasea/Controller/Prod/QueryTest.php index a89a2a2877..3cc103a18b 100644 --- a/tests/Alchemy/Tests/Phrasea/Controller/Prod/QueryTest.php +++ b/tests/Alchemy/Tests/Phrasea/Controller/Prod/QueryTest.php @@ -13,10 +13,6 @@ use Prophecy\Argument; */ class QueryTest extends \PhraseanetAuthenticatedWebTestCase { - - /** - * @covers Alchemy\Phrasea\Controller\Prod\Query::query - */ public function testQuery() { $route = '/prod/query/'; @@ -46,9 +42,6 @@ class QueryTest extends \PhraseanetAuthenticatedWebTestCase $this->assertInternalType('array', $data); } - /** - * @covers Alchemy\Phrasea\Controller\Prod\Query::queryAnswerTrain - */ public function testQueryAnswerTrain() { $app = $this->mockElasticsearchResult(self::$DI['record_2']); @@ -58,13 +51,11 @@ class QueryTest extends \PhraseanetAuthenticatedWebTestCase $options->onCollections($app->getAclForUser($app->getAuthenticatedUser())->get_granted_base()); $serializedOptions = $options->serialize(); - $client = $this->getClient(); - $client->request('POST', '/prod/query/answer-train/', [ + $response = $this->request('POST', '/prod/query/answer-train/', [ 'options_serial' => $serializedOptions, 'pos' => 0, 'query' => '' ]); - $response = $client->getResponse(); $this->assertTrue($response->isOk()); $datas = (array) json_decode($response->getContent()); $this->assertArrayHasKey('current', $datas); diff --git a/tests/Alchemy/Tests/Phrasea/Controller/Prod/RecordsTest.php b/tests/Alchemy/Tests/Phrasea/Controller/Prod/RecordsTest.php index f188060e4d..2a94180c1f 100644 --- a/tests/Alchemy/Tests/Phrasea/Controller/Prod/RecordsTest.php +++ b/tests/Alchemy/Tests/Phrasea/Controller/Prod/RecordsTest.php @@ -18,9 +18,6 @@ class RecordsTest extends \PhraseanetAuthenticatedWebTestCase { protected $client; - /** - * @covers Alchemy\Phrasea\Controller\Prod\Records::whatCanIDelete - */ public function testWhatCanIDelete() { self::$DI['client']->request('POST', '/prod/records/delete/what/', ['lst' => self::$DI['record_1']->get_serialize_key()]); @@ -29,9 +26,6 @@ class RecordsTest extends \PhraseanetAuthenticatedWebTestCase unset($response); } - /** - * @covers Alchemy\Phrasea\Controller\Prod\Records::doDeleteRecords - */ public function testDoDeleteRecords() { $file = new File(self::$DI['app'], self::$DI['app']['mediavorus']->guess(__DIR__ . '/../../../../../files/cestlafete.jpg'), self::$DI['collection']); @@ -47,9 +41,6 @@ class RecordsTest extends \PhraseanetAuthenticatedWebTestCase } } - /** - * @covers Alchemy\Phrasea\Controller\Prod\Records::renewUrl - */ public function testRenewUrl() { $file = new File(self::$DI['app'], self::$DI['app']['mediavorus']->guess(__DIR__ . '/../../../../../files/cestlafete.jpg'), self::$DI['collection']); @@ -60,9 +51,6 @@ class RecordsTest extends \PhraseanetAuthenticatedWebTestCase $record->delete(); } - /** - * @covers Alchemy\Phrasea\Controller\Prod\Records::getRecord - */ public function testGetRecordDetailNotAjax() { self::$DI['client']->request('POST', '/prod/records/'); @@ -108,9 +96,6 @@ class RecordsTest extends \PhraseanetAuthenticatedWebTestCase $this->assertArrayHasKey('title', $data); } - /** - * @covers Alchemy\Phrasea\Controller\Prod\Records::getRecord - */ public function testGetRecordDetailResult() { $app = $this->mockElasticsearchResult(self::$DI['record_1']); @@ -141,9 +126,6 @@ class RecordsTest extends \PhraseanetAuthenticatedWebTestCase $this->assertArrayHasKey('title', $data); } - /** - * @covers Alchemy\Phrasea\Controller\Prod\Records::getRecord - */ public function testGetRecordDetailREG() { $this->authenticate(self::$DI['app']); @@ -168,9 +150,6 @@ class RecordsTest extends \PhraseanetAuthenticatedWebTestCase $this->assertObjectHasAttribute('title', $data); } - /** - * @covers Alchemy\Phrasea\Controller\Prod\Records::getRecord - */ public function testGetRecordDetailBasket() { $this->authenticate(self::$DI['app']); @@ -198,9 +177,6 @@ class RecordsTest extends \PhraseanetAuthenticatedWebTestCase unset($response, $data); } - /** - * @covers Alchemy\Phrasea\Controller\Prod\Records::getRecord - */ public function testGetRecordDetailFeed() { $this->authenticate(self::$DI['app']);