Skip to content

Commit 2148104

Browse files
committed
Updated CustomNamespaces test
1 parent 82fb8aa commit 2148104

File tree

1 file changed

+19
-2
lines changed

1 file changed

+19
-2
lines changed

tests/CustomNamespaces.test.php

Lines changed: 19 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -88,15 +88,32 @@ class Item extends FilesItem
8888
/**
8989
* Write the files
9090
*/
91-
file_put_contents("{$testDir}Driver.php", $driverClassString);
92-
file_put_contents("{$testDir}Item.php", $itemClassString);
91+
92+
93+
if(!file_put_contents("{$testDir}Driver.php", $driverClassString)
94+
|| !file_put_contents("{$testDir}Item.php", $itemClassString)
95+
){
96+
$testHelper->printFailText('The php files of driver "Files2" were not written');
97+
$testHelper->terminateTest();
98+
}else{
99+
$testHelper->printPassText('The php files of driver "Files2" were written');
100+
}
93101

94102
/**
95103
* Then adjust the Chmod
96104
*/
97105
chmod("{$testDir}Driver.php", 0644);
98106
chmod("{$testDir}Item.php", 0644);
99107

108+
if(!class_exists(phpFastCache\CustomDriversPath\Files2\Item::class)
109+
|| !class_exists(phpFastCache\CustomDriversPath\Files2\Driver::class)
110+
){
111+
$testHelper->printFailText('The php classes of driver "Files2" does not exists');
112+
$testHelper->terminateTest();
113+
}else{
114+
$testHelper->printPassText('The php classes of driver "Files2" were found');
115+
}
116+
100117
CacheManager::setNamespacePath(phpFastCache\CustomDriversPath::class . '\\');
101118
$cacheInstance = CacheManager::getInstance('Files2', []);
102119
$cacheKey = 'cacheKey';

0 commit comments

Comments
 (0)