Skip to content
Snippets Groups Projects
Commit f109b1a3 authored by Patrick Barroca's avatar Patrick Barroca :grin:
Browse files

fix regression in 6.45 default module preferences loading

parent 578c507a
Branches
Tags
5 merge requests!258Dev/13872 Orphee Allow Hold Available Items,!215Dev#12992 Custom Fields,!180Master,!178Hotline 6.45,!175Master
......@@ -1389,7 +1389,7 @@ class Class_Profil extends Storm_Model_Abstract {
* @return bool
*/
public function isPortail() {
return 1 === $this->getId();
return 1 === (int)$this->getId();
}
......
......@@ -1368,4 +1368,32 @@ class ProfilPreferenceAuthRegisterTest extends Storm_Test_ModelTestCase {
$this->youth->getModulePreference('auth', 'register', 'register_confirm'));
}
}
class ProfilIsPortalTest extends Storm_Test_ModelTestCase {
/** @test */
public function profilWithIdOneIntShouldBePortal() {
$this->assertTrue($this->fixture('Class_Profil', ['id' => 1])->isPortail());
}
/** @test */
public function profilWithIdOneStringShouldBePortal() {
$this->assertTrue($this->fixture('Class_Profil', ['id' => '1'])->isPortail());
}
/** @test */
public function profilWithIdSevenIntShouldBePortal() {
$this->assertFalse($this->fixture('Class_Profil', ['id' => 7])->isPortail());
}
/** @test */
public function profilWithIdSevenStringShouldNotBePortal() {
$this->assertFalse($this->fixture('Class_Profil', ['id' => '7'])->isPortail());
}
}
?>
\ No newline at end of file
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