Skip to content

Commit

Permalink
refactoring of test that test with stdClass
Browse files Browse the repository at this point in the history
  • Loading branch information
Gjero Krsteski committed Oct 22, 2015
1 parent e7bbb63 commit b8784e7
Show file tree
Hide file tree
Showing 5 changed files with 11 additions and 12 deletions.
9 changes: 4 additions & 5 deletions app/index.php
Original file line number Diff line number Diff line change
Expand Up @@ -92,8 +92,8 @@ function flash_msg(&$check, $msg)
$_SERVER['PHP_AUTH_USER'] != $authentication['username'] ||
$_SERVER['PHP_AUTH_PW'] != $authentication['password']
) {
Header("WWW-Authenticate: Basic realm=\"PHP DBA Cache Login\"");
Header("HTTP/1.0 401 Unauthorized");
header("WWW-Authenticate: Basic realm=\"PHP DBA Cache Login\"");
header("HTTP/1.0 401 Unauthorized");
exit;
}
$authenticated = true;
Expand All @@ -118,10 +118,9 @@ function flash_msg(&$check, $msg)
}

if ($authenticated && isset($_POST['delete-all'])) {

try {
$delete_all = $sweep->flush();
} catch (RuntimeException $re) {
} catch (\RuntimeException $re) {
$delete_all = false;
}

Expand All @@ -139,7 +138,7 @@ function flash_msg(&$check, $msg)
}

clearstatcache();
$file_info = new SplFileInfo($file);
$file_info = new \SplFileInfo($file);
?>
<!DOCTYPE html>
<html lang="en">
Expand Down
2 changes: 1 addition & 1 deletion tests/Handlers/CdbReadTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ public function testWithPersistentConnection()

$this->assertTrue($cacheRead->has(md5('test123')));

$this->assertInstanceOf('\PhpDbaCache\stdClass', $cacheRead->get(md5('test123')));
$this->assertInstanceOf('\stdClass', $cacheRead->get(md5('test123')));

$cacheRead->closeDba();
}
Expand Down
4 changes: 2 additions & 2 deletions tests/Handlers/Db4Test.php
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ public function testWithoutPersistentConnection()

$cache->put($this->identifier, $this->testObject);

$this->assertInstanceOf('\PhpDbaCache\stdClass', $cache->get($this->identifier));
$this->assertInstanceOf('\stdClass', $cache->get($this->identifier));

$cache->closeDba();
}
Expand All @@ -46,7 +46,7 @@ public function testOracleBerkeleyDb4HandlerBeSupportedWithPersistantConnection(

$cache->put($this->identifier, $this->testObject);

$this->assertInstanceOf('\PhpDbaCache\stdClass', $cache->get($this->identifier));
$this->assertInstanceOf('\stdClass', $cache->get($this->identifier));

$cache->closeDba();
}
Expand Down
4 changes: 2 additions & 2 deletions tests/Handlers/GdbmTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ public function testWriteAndReadWithoutPersistentConnection()

$cache->put($this->identifier, $this->testObject);

$this->assertInstanceOf('\PhpDbaCache\stdClass', $cache->get($this->identifier));
$this->assertInstanceOf('\stdClass', $cache->get($this->identifier));
}

/**
Expand All @@ -45,7 +45,7 @@ public function testWriteAndReaddWithPersistentConnection()

$cache->put($this->identifier, $this->testObject);

$this->assertInstanceOf('\PhpDbaCache\stdClass', $cache->get($this->identifier));
$this->assertInstanceOf('\stdClass', $cache->get($this->identifier));
}

}
4 changes: 2 additions & 2 deletions tests/Handlers/QdbmTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ public function testWriteAndReadWithoutPersistentConnection()

$cache->put($this->identifier, $this->testObject);

$this->assertInstanceOf('\PhpDbaCache\stdClass', $cache->get($this->identifier));
$this->assertInstanceOf('\stdClass', $cache->get($this->identifier));
}

/**
Expand All @@ -47,6 +47,6 @@ public function testWriteAndReaddWithPersistentConnection()

$cache->put($this->identifier, $this->testObject);

$this->assertInstanceOf('\PhpDbaCache\stdClass', $cache->get($this->identifier));
$this->assertInstanceOf('\stdClass', $cache->get($this->identifier));
}
}

0 comments on commit b8784e7

Please sign in to comment.