mirror of
https://github.com/alchemy-fr/Phraseanet.git
synced 2025-10-17 23:13:15 +00:00
Fix neutron's comment
This commit is contained in:
@@ -363,4 +363,43 @@ class collectionTest extends \PhraseanetAuthenticatedTestCase
|
||||
'This test has not been implemented yet.'
|
||||
);
|
||||
}
|
||||
|
||||
/**
|
||||
* @dataProvider collectionXmlConfiguration
|
||||
*/
|
||||
public function testIsRegistrationEnabled($data, $value)
|
||||
{
|
||||
$mock = $this->getMockBuilder('\collection')
|
||||
->disableOriginalConstructor()
|
||||
->setMethods(['get_prefs'])
|
||||
->getMock();
|
||||
|
||||
$mock->expects($this->once())->method('get_prefs')->will($this->returnValue($data));
|
||||
$this->assertEquals($value, $mock->isRegistrationEnabled());
|
||||
}
|
||||
|
||||
public function collectionXmlConfiguration()
|
||||
{
|
||||
$xmlInscript =
|
||||
<<<XML
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<baseprefs><caninscript>1</caninscript>1</baseprefs>
|
||||
XML;
|
||||
$xmlNoInscript =
|
||||
<<<XML
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<baseprefs><caninscript>0</caninscript>1</baseprefs>
|
||||
XML;
|
||||
$xmlNoInscriptEmpty =
|
||||
<<<XML
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<baseprefs><caninscript></caninscript></baseprefs>
|
||||
XML;
|
||||
|
||||
return [
|
||||
[$xmlInscript, true],
|
||||
[$xmlNoInscript, false],
|
||||
[$xmlNoInscriptEmpty, false],
|
||||
];
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user