Skip to content

Commit fbb0ad0

Browse files
committed
Merge pull request tedious#168 from tedivm/DriverList
Renamed Drivers class to DriverList
2 parents 881d530 + 378f72b commit fbb0ad0

File tree

3 files changed

+15
-13
lines changed

3 files changed

+15
-13
lines changed

CHANGELOG.md

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -30,9 +30,11 @@
3030

3131
* Replaced "Item->setDriver" with "Item->setPool" function. This should have no effect on typical consumers of this library but may effect those extending the Item or Pool class.
3232

33-
* Added Drivers::getAllDrivers which returns an unfiltered list of registered drivers.
33+
* Renamed Drivers class to DriversList to prevent confusion when talking about "Drivers".
3434

35-
* Added Drivers::getAvailableDrivers to replace the existing Drivers::getDrivers, which is now deprecated.
35+
* Added DriversList::getAllDrivers which returns an unfiltered list of registered drivers.
36+
37+
* Added DriversList::getAvailableDrivers to replace the existing DriversList::getDrivers, which is now deprecated.
3638

3739
* Added "setDriver(DriverInterface $driver)" and "setKey($key, $namespace = null)" functions to the Item Interface. These functions are used by Pool to initialize the Item class.
3840

src/Stash/Drivers.php renamed to src/Stash/DriverList.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,12 +12,12 @@
1212
namespace Stash;
1313

1414
/**
15-
* Drivers contains various functions used to organize Driver classes that are available in the system.
15+
* DriverList contains various functions used to organize Driver classes that are available in the system.
1616
*
1717
* @package Stash
1818
* @author Robert Hafner <tedivm@tedivm.com>
1919
*/
20-
class Drivers
20+
class DriverList
2121
{
2222
/**
2323
* An array of possible cache storage data methods, with the driver class as the array value.

tests/Stash/Test/DriversTest.php renamed to tests/Stash/Test/DriverListTest.php

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -11,42 +11,42 @@
1111

1212
namespace Stash\Test;
1313

14-
use Stash\Drivers;
14+
use Stash\DriverList;
1515

1616
/**
1717
* @package Stash
1818
* @author Robert Hafner <tedivm@tedivm.com>
1919
*/
20-
class DriversTest extends \PHPUnit_Framework_TestCase
20+
class DriverListTest extends \PHPUnit_Framework_TestCase
2121
{
2222
public function testGetAvailableDrivers()
2323
{
24-
$drivers = Drivers::getAvailableDrivers();
24+
$drivers = DriverList::getAvailableDrivers();
2525
$this->assertArrayHasKey('FileSystem', $drivers, 'getDrivers returns FileSystem driver');
2626
$this->assertArrayNotHasKey('Array', $drivers, 'getDrivers doesn\'t return Array driver');
2727
}
2828

2929
public function testGetDrivers()
3030
{
31-
$availableDrivers = Drivers::getAvailableDrivers();
32-
$getDrivers = Drivers::getDrivers();
31+
$availableDrivers = DriverList::getAvailableDrivers();
32+
$getDrivers = DriverList::getDrivers();
3333
$this->assertEquals($availableDrivers, $getDrivers, 'getDrivers is an alias for getAvailableDrivers');
3434

3535
}
3636

3737
public function testRegisterDriver()
3838
{
39-
Drivers::registerDriver('Array', 'Stash\Driver\Ephemeral');
39+
DriverList::registerDriver('Array', 'Stash\Driver\Ephemeral');
4040

41-
$drivers = Drivers::getDrivers();
41+
$drivers = DriverList::getDrivers();
4242
$this->assertArrayHasKey('Array', $drivers, 'getDrivers returns Array driver');
4343
}
4444

4545
public function testGetDriverClass()
4646
{
47-
$this->assertEquals('Stash\Driver\Ephemeral', Drivers::getDriverClass('Array'), 'getDriverClass returns proper classname for Array driver');
47+
$this->assertEquals('Stash\Driver\Ephemeral', DriverList::getDriverClass('Array'), 'getDriverClass returns proper classname for Array driver');
4848

49-
$this->assertFalse(Drivers::getDriverClass('FakeName'), 'getDriverClass returns false for nonexistent class.');
49+
$this->assertFalse(DriverList::getDriverClass('FakeName'), 'getDriverClass returns false for nonexistent class.');
5050

5151
}
5252

0 commit comments

Comments
 (0)