diff --git a/lib/Alchemy/Phrasea/Controller/Prod/WorkZone.php b/lib/Alchemy/Phrasea/Controller/Prod/WorkZone.php index 8725e72198..4ab3b1400b 100644 --- a/lib/Alchemy/Phrasea/Controller/Prod/WorkZone.php +++ b/lib/Alchemy/Phrasea/Controller/Prod/WorkZone.php @@ -138,7 +138,7 @@ class WorkZone implements ControllerProviderInterface $StoryWZRepo = $em->getRepository('\Entities\StoryWZ'); $alreadyFixed = $done = 0; - + foreach (explode(';', $request->get('stories')) as $element) { $element = explode('_', $element); diff --git a/lib/Alchemy/Phrasea/Vocabulary/ControlProvider/UserProvider.php b/lib/Alchemy/Phrasea/Vocabulary/ControlProvider/UserProvider.php index ce50a7db91..bbaf5a9805 100644 --- a/lib/Alchemy/Phrasea/Vocabulary/ControlProvider/UserProvider.php +++ b/lib/Alchemy/Phrasea/Vocabulary/ControlProvider/UserProvider.php @@ -88,7 +88,7 @@ class UserProvider implements ControlProviderInterface } catch (\Exception $e) { - + } return false; diff --git a/lib/Doctrine/Repositories/UsrListOwnerRepository.php b/lib/Doctrine/Repositories/UsrListOwnerRepository.php index ec44b0a464..789204c841 100644 --- a/lib/Doctrine/Repositories/UsrListOwnerRepository.php +++ b/lib/Doctrine/Repositories/UsrListOwnerRepository.php @@ -50,7 +50,7 @@ class UsrListOwnerRepository extends EntityRepository $dql = 'SELECT o FROM Entities\UsrListOwner o JOIN o.list l WHERE l.id = :list_id AND o.usr_id = :usr_id'; - + $params = array( 'usr_id' => $usr_id, 'list_id' => $list->getId() @@ -60,7 +60,7 @@ class UsrListOwnerRepository extends EntityRepository $query->setParameters($params); $owner = $query->getSingleResult(); - + /* @var $owner \Entities\UsrListOwner */ if (null === $owner) { diff --git a/lib/unitTest/Alchemy/Phrasea/Controller/Prod/MustacheLoaderTest.php b/lib/unitTest/Alchemy/Phrasea/Controller/Prod/MustacheLoaderTest.php index f6a23a001a..1b602545b2 100644 --- a/lib/unitTest/Alchemy/Phrasea/Controller/Prod/MustacheLoaderTest.php +++ b/lib/unitTest/Alchemy/Phrasea/Controller/Prod/MustacheLoaderTest.php @@ -24,7 +24,7 @@ class MustacheLoaderTest extends \PhraseanetWebTestCaseAuthenticatedAbstract public function testRouteSlash() { - + $this->client->request('GET', '/MustacheLoader/'); $response = $this->client->getResponse(); @@ -32,7 +32,7 @@ class MustacheLoaderTest extends \PhraseanetWebTestCaseAuthenticatedAbstract $this->assertEquals(400, $response->getStatusCode()); $this->assertFalse($response->isOk()); - + $this->client->request('GET', '/MustacheLoader/', array('template' => '/../../../../config/config.yml')); $response = $this->client->getResponse(); @@ -40,7 +40,7 @@ class MustacheLoaderTest extends \PhraseanetWebTestCaseAuthenticatedAbstract $this->assertEquals(400, $response->getStatusCode()); $this->assertFalse($response->isOk()); - + $this->client->request('GET', '/MustacheLoader/', array('template' => 'patator_lala')); $response = $this->client->getResponse(); @@ -48,7 +48,7 @@ class MustacheLoaderTest extends \PhraseanetWebTestCaseAuthenticatedAbstract $this->assertEquals(404, $response->getStatusCode()); $this->assertFalse($response->isOk()); - + $this->client->request('GET', '/MustacheLoader/', array('template' => 'Push-Badge')); $response = $this->client->getResponse(); diff --git a/lib/unitTest/Alchemy/Phrasea/Controller/Prod/UsrListsTest.php b/lib/unitTest/Alchemy/Phrasea/Controller/Prod/UsrListsTest.php index c5e3946e9f..22e82dde1f 100644 --- a/lib/unitTest/Alchemy/Phrasea/Controller/Prod/UsrListsTest.php +++ b/lib/unitTest/Alchemy/Phrasea/Controller/Prod/UsrListsTest.php @@ -278,7 +278,7 @@ class ControllerUsrListsTest extends \PhraseanetWebTestCaseAuthenticatedAbstract $this->assertEquals(400, $response->getStatusCode()); $this->assertEquals('UTF-8', $response->getCharset()); - + $route = '/lists/list/' . $list->getId() . '/share/' . self::$user_alt1->get_id() . '/'; @@ -314,13 +314,13 @@ class ControllerUsrListsTest extends \PhraseanetWebTestCaseAuthenticatedAbstract $this->assertEquals(2, $list->getOwners()->count()); } - - - + + + public function testPostUnShareList() { - + $list = $this->insertOneUsrList(self::$user); $this->assertEquals(1, $list->getOwners()->count()); @@ -347,9 +347,9 @@ class ControllerUsrListsTest extends \PhraseanetWebTestCaseAuthenticatedAbstract $list = $repository->find($list->getId()); $this->assertEquals(2, $list->getOwners()->count()); - - - + + + $route = '/lists/list/' . $list->getId() . '/unshare/' . self::$user_alt1->get_id() . '/'; $this->client->request('POST', $route); @@ -360,23 +360,23 @@ class ControllerUsrListsTest extends \PhraseanetWebTestCaseAuthenticatedAbstract $this->assertEquals('UTF-8', $response->getCharset()); $datas = (array) json_decode($response->getContent()); - + $this->assertTrue($datas['success']); $repository = self::$core->getEntityManager()->getRepository('Entities\UsrList'); $list = $repository->find($list->getId()); - + self::$core->getEntityManager()->refresh($list); $this->assertEquals(1, $list->getOwners()->count()); } - + public function testPostUnShareFail() { - + $list = $this->insertOneUsrList(self::$user); $this->assertEquals(1, $list->getOwners()->count()); @@ -397,9 +397,9 @@ class ControllerUsrListsTest extends \PhraseanetWebTestCaseAuthenticatedAbstract $this->assertArrayHasKey('message', $datas); $this->assertTrue($datas['success']); - - - + + + $route = '/lists/list/' . $list->getId() . '/share/' . self::$user->get_id() . '/'; $this->client->request('POST', $route, array('role' => \Entities\UsrListOwner::ROLE_USER)); @@ -416,18 +416,18 @@ class ControllerUsrListsTest extends \PhraseanetWebTestCaseAuthenticatedAbstract $this->assertArrayHasKey('message', $datas); $this->assertTrue($datas['success']); - - - + + + $repository = self::$core->getEntityManager()->getRepository('Entities\UsrList'); $list = $repository->find($list->getId()); $this->assertEquals(2, $list->getOwners()->count()); - - - + + + $route = '/lists/list/' . $list->getId() . '/unshare/' . self::$user_alt1->get_id() . '/'; $this->client->request('POST', $route); @@ -438,7 +438,7 @@ class ControllerUsrListsTest extends \PhraseanetWebTestCaseAuthenticatedAbstract $this->assertEquals('UTF-8', $response->getCharset()); $datas = (array) json_decode($response->getContent()); - + $this->assertFalse($datas['success']); } diff --git a/lib/unitTest/Alchemy/Phrasea/Controller/Prod/WorkZoneTest.php b/lib/unitTest/Alchemy/Phrasea/Controller/Prod/WorkZoneTest.php index dad70b8b72..889fa128b1 100644 --- a/lib/unitTest/Alchemy/Phrasea/Controller/Prod/WorkZoneTest.php +++ b/lib/unitTest/Alchemy/Phrasea/Controller/Prod/WorkZoneTest.php @@ -60,7 +60,7 @@ class ControllerWorkZoneTest extends \PhraseanetWebTestCaseAuthenticatedAbstract $story = self::$story_1; /* @var $story \Record_Adapter */ $route = sprintf("/WorkZone/attachStories/"); - + $this->client->request('POST', $route); $response = $this->client->getResponse(); @@ -71,7 +71,7 @@ class ControllerWorkZoneTest extends \PhraseanetWebTestCaseAuthenticatedAbstract $response = $this->client->getResponse(); $this->assertEquals(302, $response->getStatusCode()); - + $em = self::$core->getEntityManager(); /* @var $em \Doctrine\ORM\EntityManager */ $query = $em->createQuery( @@ -81,17 +81,17 @@ class ControllerWorkZoneTest extends \PhraseanetWebTestCaseAuthenticatedAbstract $count = $query->getSingleScalarResult(); $this->assertEquals(1, $count); - + $story2 = self::$story_2; - + $stories = implode(';', array($story->get_serialize_key(), $story2->get_serialize_key())); $this->client->request('POST', $route, array('stories' => $stories)); $response = $this->client->getResponse(); $this->assertEquals(302, $response->getStatusCode()); - - + + $em = self::$core->getEntityManager(); /* @var $em \Doctrine\ORM\EntityManager */ diff --git a/lib/unitTest/Alchemy/Phrasea/Core/Configuration/ConfigurationTest.php b/lib/unitTest/Alchemy/Phrasea/Core/Configuration/ConfigurationTest.php index fa7f8eb7ff..03d18c5f98 100644 --- a/lib/unitTest/Alchemy/Phrasea/Core/Configuration/ConfigurationTest.php +++ b/lib/unitTest/Alchemy/Phrasea/Core/Configuration/ConfigurationTest.php @@ -162,7 +162,7 @@ class ConfigurationTest extends \PhraseanetPHPUnitAbstract } catch (\Exception $e) { - + } } @@ -204,7 +204,7 @@ class ConfigurationTest extends \PhraseanetPHPUnitAbstract } catch (\Exception $e) { - + } } @@ -222,7 +222,7 @@ class ConfigurationTest extends \PhraseanetPHPUnitAbstract } catch (\Exception $e) { - + } } @@ -246,7 +246,7 @@ class ConfigurationTest extends \PhraseanetPHPUnitAbstract public function testWrite() { touch(__DIR__ . "/confTestFiles/yamlWriteTest.yml"); - + $stub = $this->getMock( '\Alchemy\Phrasea\Core\Configuration\Application' , array('getConfigurationPathName') @@ -284,7 +284,7 @@ class ConfigurationTest extends \PhraseanetPHPUnitAbstract public function testWriteException() { touch(__DIR__ . "/confTestFiles/yamlWriteTest.yml"); - + $stub = $this->getMock( '\Alchemy\Phrasea\Core\Configuration\Application' , array('getConfigurationPathName') @@ -318,7 +318,7 @@ class ConfigurationTest extends \PhraseanetPHPUnitAbstract } catch (\exception $e) { - + } chmod($file->getPathname(), 0666); } @@ -326,7 +326,7 @@ class ConfigurationTest extends \PhraseanetPHPUnitAbstract public function testDelete() { touch(__DIR__ . "/confTestFiles/yamlWriteTest.yml"); - + $stub = $this->getMock( '\Alchemy\Phrasea\Core\Configuration\Application' , array('getConfigurationPathName') @@ -343,17 +343,17 @@ class ConfigurationTest extends \PhraseanetPHPUnitAbstract $handler = new Configuration\Handler($stub, new Configuration\Parser\Yaml()); $configuration = new PhraseaCore\Configuration($handler); - + $configuration->delete(); - + $this->assertFileNotExists($file->getPathname()); - + } // public function testDeleteException() // { // touch(__DIR__ . "/confTestFiles/yamlWriteTest.yml"); -// +// // $stub = $this->getMock( // '\Alchemy\Phrasea\Core\Configuration\Application' // , array('getConfigurationPathName') @@ -380,9 +380,9 @@ class ConfigurationTest extends \PhraseanetPHPUnitAbstract // { // // } -// +// // $this->assertFileExists($file->getPathname()); -// +// // } } diff --git a/lib/unitTest/Alchemy/Phrasea/Vocabulary/ControlProvider/UserProviderTest.php b/lib/unitTest/Alchemy/Phrasea/Vocabulary/ControlProvider/UserProviderTest.php index 82635d3dd9..770f4fe361 100644 --- a/lib/unitTest/Alchemy/Phrasea/Vocabulary/ControlProvider/UserProviderTest.php +++ b/lib/unitTest/Alchemy/Phrasea/Vocabulary/ControlProvider/UserProviderTest.php @@ -25,11 +25,11 @@ class UserProviderTest extends \PhraseanetPHPUnitAbstract public function testGetType() { $type = $this->object->getType(); - + $this->assertTrue(is_scalar($type)); - + $classname = array_pop(explode('\\', get_class($this->object))); - + $this->assertEquals($classname, $type . 'Provider'); } @@ -41,21 +41,21 @@ class UserProviderTest extends \PhraseanetPHPUnitAbstract public function testFind() { $results = $this->object->find('BABE', self::$user, self::$collection->get_databox()); - + $this->assertInstanceOf('\\Doctrine\\Common\\Collections\\ArrayCollection', $results); - + $results = $this->object->find(self::$user->get_email(), self::$user, self::$collection->get_databox()); - + $this->assertInstanceOf('\\Doctrine\\Common\\Collections\\ArrayCollection', $results); $this->assertTrue($results->count() > 0); - + $results = $this->object->find(self::$user->get_firstname(), self::$user, self::$collection->get_databox()); - + $this->assertInstanceOf('\\Doctrine\\Common\\Collections\\ArrayCollection', $results); $this->assertTrue($results->count() > 0); - + $results = $this->object->find(self::$user->get_lastname(), self::$user, self::$collection->get_databox()); - + $this->assertInstanceOf('\\Doctrine\\Common\\Collections\\ArrayCollection', $results); $this->assertTrue($results->count() > 0); } @@ -76,9 +76,9 @@ class UserProviderTest extends \PhraseanetPHPUnitAbstract } catch(\Exception $e) { - + } - + try { $this->object->getValue('A'); @@ -86,9 +86,9 @@ class UserProviderTest extends \PhraseanetPHPUnitAbstract } catch(\Exception $e) { - + } - + $this->assertEquals(self::$user->get_display_name(), $this->object->getValue(self::$user->get_id())); } diff --git a/lib/unitTest/Alchemy/Phrasea/Vocabulary/ControllerTest.php b/lib/unitTest/Alchemy/Phrasea/Vocabulary/ControllerTest.php index 6a5d71f999..7ab33c47a8 100644 --- a/lib/unitTest/Alchemy/Phrasea/Vocabulary/ControllerTest.php +++ b/lib/unitTest/Alchemy/Phrasea/Vocabulary/ControllerTest.php @@ -12,7 +12,7 @@ class ControllerTest extends \PhraseanetPHPUnitAbstract public function testGet() { $provider = \Alchemy\Phrasea\Vocabulary\Controller::get('User'); - + $this->assertInstanceOf('\\Alchemy\\Phrasea\\Vocabulary\\ControlProvider\\UserProvider', $provider); try @@ -22,16 +22,16 @@ class ControllerTest extends \PhraseanetPHPUnitAbstract } catch(\Exception $e) { - + } } public function testGetAvailable() { $available = \Alchemy\Phrasea\Vocabulary\Controller::getAvailable(); - + $this->assertTrue(is_array($available)); - + foreach($available as $controller) { $this->assertInstanceOf('\\Alchemy\\Phrasea\\Vocabulary\\ControlProvider\\ControlProviderInterface', $controller); diff --git a/lib/unitTest/Alchemy/Phrasea/Vocabulary/TermTest.php b/lib/unitTest/Alchemy/Phrasea/Vocabulary/TermTest.php index 98f9113a9d..dc5a751123 100644 --- a/lib/unitTest/Alchemy/Phrasea/Vocabulary/TermTest.php +++ b/lib/unitTest/Alchemy/Phrasea/Vocabulary/TermTest.php @@ -26,7 +26,7 @@ class TermTest extends \PhraseanetPHPUnitAbstract */ protected $objectWithControl; protected $value2 = 'Supa valu&é"\'(§è!)'; - protected $context2 = 'context + protected $context2 = 'context oualibi'; protected $basicValue = 'Joli chien'; protected $value = 'One value';