Commit 29999abb authored by Ghislain Loas's avatar Ghislain Loas

dev #75244 fix indent

parent fc24195c
......@@ -21,8 +21,10 @@
abstract class LesYeuxDocActivatedTestCase extends Admin_AbstractControllerTestCase {
protected $_storm_default_to_volatile = true;
public function setUp() {
parent::setUp();
......@@ -72,6 +74,7 @@ abstract class LesYeuxDocActivatedTestCase extends Admin_AbstractControllerTestC
class LesYeuDocDashboardTestCase extends LesYeuxDocActivatedTestCase {
public function setUp() {
parent::setUp();
$this->dispatch('/LesYeuxDoc_Plugin', true);
......@@ -102,7 +105,10 @@ class LesYeuDocDashboardTestCase extends LesYeuxDocActivatedTestCase {
class LesYeuxDocFixtures {
use Storm_Test_THelpers;
public function activate() {
Class_AdminVar::set('LesYeuxDoc_SSO_URL', 'http://lesyeuxdoc.com');
Class_AdminVar::newInstanceWithId('LesYeuxDoc_SSO_KEY', ['valeur' => 'pass']);
......@@ -121,6 +127,7 @@ class LesYeuxDocFixtures {
return $this;
}
public function prepare() {
$page1 = file_get_contents(__DIR__ . '/page1.json');
$page2 = file_get_contents(__DIR__ . '/page2.json');
......@@ -147,10 +154,6 @@ class LesYeuxDocFixtures {
->with('https://www.lesyeuxdoc.fr/img/thumbnail/a514b069-43cc-4d71-9e3c-55ac267e667a/front_result.jpg')
->answers(true);
LesYeuxDoc_Service::setDefaultHttpClient($http_client);
return LesYeuxDoc_Service::getInstance();
......@@ -184,15 +187,17 @@ class LesYeuxDocFixtures {
'code' => 'LesYeuxDoc'])
->permitTo($group, new Class_Entity());
}
}
class LesYeuxDocModuleTest extends AbstractControllerTestCase {
protected
$_storm_default_to_volatile = true;
public function setUp() {
parent::setUp();
Storm_Cache::beVolatile();
......@@ -217,17 +222,19 @@ class LesYeuxDocModuleTest extends AbstractControllerTestCase {
(new LesYeuxDocFixtures())->logValidUser();
$this->dispatch('/opac/modules/les-yeux-doc', true);
$this->assertRedirect();
//To("https://portal.mediatheque-numerique.com/sso_login?sso_id=afi&id=666&id_encrypted=ce04173447e59a7a3608f625b0348ccec5f4070c7c3f286b032cbe6374ec9f32&d=d8fb24f80a99bded9ed417591c5ac5cc1e123bccfe10d65e1f6a83211ca18d3e8&return_url=https%3A%2F%2Fvod.mediatheque-numerique.com%2Fmediatheques%2Fuser");
}
}
class LesYeuxDocHarvestTest extends ModelTestCase {
protected
$_storm_default_to_volatile = true,
$_destination;
public function setUp() {
parent::setUp();
(new LesYeuxDocFixtures())->activate()->prepare()->harvest();
......@@ -278,9 +285,12 @@ class LesYeuxDocHarvestTest extends ModelTestCase {
class LesYeuDocModuleSsoTest extends AbstractControllerTestCase {
protected $_storm_default_to_volatile = true,
protected
$_storm_default_to_volatile = true,
$fixtures ;
public function setUp() {
parent::setUp();
$this->fixtures = new LesYeuxDocFixtures();
......@@ -312,10 +322,12 @@ class LesYeuDocModuleSsoTest extends AbstractControllerTestCase {
class LesYeuxDocLinkTest extends AbstractControllerTestCase {
protected $session_file_contents_logged;
protected $session_file_contents_nologin;
protected
$session_file_contents_logged,
$session_file_contents_nologin;
public function setUp() {
parent::setUp();
......@@ -325,18 +337,18 @@ class LesYeuxDocLinkTest extends AbstractControllerTestCase {
$fixtures->activate();
$fixtures->logValidUser();
}
}
class LesYeuxDocViewRecordTest extends AbstractControllerTestCase {
protected $_storm_default_to_volatile = true,
protected
$_storm_default_to_volatile = true,
$fixtures;
public function setUp() {
parent::setUp();
$this->service = (new LesYeuxDocFixtures())->activate()->prepare();
......@@ -350,11 +362,13 @@ class LesYeuxDocViewRecordTest extends AbstractControllerTestCase {
$this->assertEquals('Jean-Philippe Toussaint', Class_Notice::find(1)->getTitrePrincipal());
}
/** @test */
public function urlOrigineShouldBeSetToUrl() {
$this->assertEquals('https://www.lesyeuxdoc.fr/api/v1/films',Class_Album::find(1)->getUrlOrigine());
}
/** @test */
public function newHavestShouldKeepNewTitle() {
Class_Album::find(1)->setTitre('My title modification')->save();
......@@ -385,11 +399,9 @@ class LesYeuxDocViewRecordTest extends AbstractControllerTestCase {
(new LesYeuxDocFixtures())->logValidUser();
$this->dispatch('/modules/les-yeux-doc/album_id/1', true);
$this->assertXPathContentContains('//script', 'return_url=https%3A%2F%2Fwww.lesyeuxdoc.fr%2Ffilm%2F682%2Fjean-philippe-toussaint"');
}
public function logValidUserNotAllowed() {
$user = $this->fixture('Class_Users',
['id' => 10,
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment