diff --git a/inc/Cache/Cache.php b/inc/Cache/Cache.php index ab64da5cb1..af82e6bf6e 100644 --- a/inc/Cache/Cache.php +++ b/inc/Cache/Cache.php @@ -78,9 +78,13 @@ public function useCache($depends = array()) $this->depends = $depends; $this->addDependencies(); - if ($this->_event) { - return $this->stats(Event::createAndTrigger( - $this->_event, $this, array($this, 'makeDefaultCacheDecision')) + if ($this->getEvent()) { + return $this->stats( + Event::createAndTrigger( + $this->getEvent(), + $this, + array($this, 'makeDefaultCacheDecision') + ) ); } @@ -105,7 +109,6 @@ public function useCache($depends = array()) */ public function makeDefaultCacheDecision() { - if ($this->_nocache) { return false; } // caching turned off @@ -170,7 +173,7 @@ public function storeCache($data) return false; } - return io_savefile($this->cache, $data); + return io_saveFile($this->cache, $data); } /** diff --git a/inc/Cache/CacheInstructions.php b/inc/Cache/CacheInstructions.php index 3c47861052..acd02abae4 100644 --- a/inc/Cache/CacheInstructions.php +++ b/inc/Cache/CacheInstructions.php @@ -41,6 +41,6 @@ public function storeCache($instructions) return false; } - return io_savefile($this->cache, serialize($instructions)); + return io_saveFile($this->cache, serialize($instructions)); } } diff --git a/lib/plugins/usermanager/_test/csv_import.test.php b/lib/plugins/usermanager/_test/csv_import.test.php index 6047a93427..13034a012b 100644 --- a/lib/plugins/usermanager/_test/csv_import.test.php +++ b/lib/plugins/usermanager/_test/csv_import.test.php @@ -14,13 +14,14 @@ * * At present, users imported in individual tests remain in the user list for subsequent tests */ -class plugin_usermanager_csv_import_test extends DokuWikiTest { - +class plugin_usermanager_csv_import_test extends DokuWikiTest +{ private $old_files; protected $usermanager; protected $importfile; - function setUp() { + public function setUp() + { $this->importfile = tempnam(TMP_DIR, 'csv'); $this->old_files = $_FILES; @@ -38,16 +39,18 @@ function setUp() { parent::setUp(); } - function tearDown() { + public function tearDown() + { $_FILES = $this->old_files; parent::tearDown(); } - function doImportTest($importCsv, $expectedResult, $expectedNewUsers, $expectedFailures) { + public function doImportTest($importCsv, $expectedResult, $expectedNewUsers, $expectedFailures) + { global $auth; $before_users = $auth->retrieveUsers(); - io_savefile($this->importfile, $importCsv); + io_saveFile($this->importfile, $importCsv); $result = $this->usermanager->tryImport(); $after_users = $auth->retrieveUsers(); @@ -69,7 +72,8 @@ function doImportTest($importCsv, $expectedResult, $expectedNewUsers, $expectedF $this->assertEquals($expectedFailures, $this->usermanager->getImportFailures()); // failures as expected } - function test_cantImport(){ + public function test_cantImport() + { global $auth; $oldauth = $auth; @@ -85,7 +89,8 @@ function test_cantImport(){ $auth = $oldauth; } - function test_import() { + public function test_import() + { $csv = 'User,"Real Name",Email,Groups importuser,"Ford Prefect",ford@example.com,user '; @@ -100,7 +105,8 @@ function test_import() { $this->doImportTest($csv, true, $expected, array()); } - function test_importExisting() { + public function test_importExisting() + { $csv = 'User,"Real Name",Email,Groups importuser,"Ford Prefect",ford@example.com,user '; @@ -120,7 +126,8 @@ function test_importExisting() { $this->doImportTest($csv, true, array(), $failures); } - function test_importUtf8() { + public function test_importUtf8() + { $csv = 'User,"Real Name",Email,Groups importutf8,"Førd Prefect",ford@example.com,user '; @@ -138,7 +145,8 @@ function test_importUtf8() { /** * utf8: u+00F8 (ø) <=> 0xF8 :iso-8859-1 */ - function test_importIso8859() { + public function test_importIso8859() + { $csv = 'User,"Real Name",Email,Groups importiso8859,"F'.chr(0xF8).'rd Prefect",ford@example.com,user '; @@ -153,14 +161,16 @@ function test_importIso8859() { $this->doImportTest($csv, true, $expected, array()); } - private function stripPasswords($array){ + private function stripPasswords($array) + { foreach ($array as $user => $data) { unset($array[$user]['pass']); } return $array; } - private function countPasswords($array){ + private function countPasswords($array) + { $count = 0; foreach ($array as $user => $data) { if (!empty($data['pass'])) { @@ -169,6 +179,4 @@ private function countPasswords($array){ } return $count; } - } -