* (c) Francis Besset * * This source file is subject to the MIT license that is bundled * with this source code in the file LICENSE. */ namespace BeSimple\Tests\SoapCommon\Soap; use BeSimple\SoapCommon\Cache; class SoapRequestTest extends \PHPUnit_Framework_TestCase { public function testSetEnabled() { Cache::setEnabled(Cache::ENABLED); $this->assertEquals(Cache::ENABLED, Cache::isEnabled()); Cache::setEnabled(Cache::DISABLED); $this->assertEquals(Cache::DISABLED, Cache::isEnabled()); } public function testSetType() { Cache::setType(Cache::TYPE_DISK); $this->assertEquals(Cache::TYPE_DISK, Cache::getType()); Cache::setType(Cache::TYPE_NONE); $this->assertEquals(Cache::TYPE_NONE, Cache::getType()); } public function testSetDirectory() { Cache::setDirectory('/foo'); $this->assertEquals('/foo', Cache::getDirectory()); Cache::setDirectory('/bar'); $this->assertEquals('/bar', Cache::getDirectory()); } public function testSetLifetime() { Cache::setLifetime(1234); $this->assertEquals(1234, Cache::getLifetime()); Cache::setLifetime(4321); $this->assertEquals(4321, Cache::getLifetime()); } public function testSetLimit() { Cache::setLimit(10); $this->assertEquals(10, Cache::getLimit()); Cache::setLimit(1); $this->assertEquals(1, Cache::getLimit()); } public function setUp() { ini_restore('soap.wsdl_cache_enabled'); ini_restore('soap.wsdl_cache'); ini_restore('soap.wsdl_cache_dir'); ini_restore('soap.wsdl_cache_ttl'); ini_restore('soap.wsdl_cache_limit'); } }