Fixed typo and added unit tests

This commit is contained in:
Francis Besset
2011-10-11 21:24:32 +02:00
parent 0f30119294
commit f95a5177b1
5 changed files with 80 additions and 9 deletions

View File

@ -44,7 +44,7 @@ class Cache
static public function setEnabled($enabled)
{
if (!in_array($enabled, array(self::ENABLED, self::DISABLED))) {
if (!in_array($enabled, array(self::ENABLED, self::DISABLED), true)) {
throw new \InvalidArgumentException();
}
@ -58,7 +58,7 @@ class Cache
static public function setType($type)
{
if (!in_array($type, self::getTypes())) {
if (!in_array($type, self::getTypes(), true)) {
throw new \InvalidArgumentException('The cache type has to be either Cache::TYPE_NONE, Cache::TYPE_DISK, Cache::TYPE_MEMORY or Cache::TYPE_DISK_MEMORY');
}