File tree Expand file tree Collapse file tree 2 files changed +3
-1
lines changed
Test/Case/Model/Datasource Expand file tree Collapse file tree 2 files changed +3
-1
lines changed Original file line number Diff line number Diff line change @@ -63,12 +63,13 @@ class RedisSource extends DataSource {
6363 *
6464 * @param array $config Array of configuration information for the Datasource
6565 * @return bool True if connecting to the DataSource succeeds, else false
66+ * @throws RedisSourceException
6667 */
6768 public function __construct ($ config = array ()) {
6869 parent ::__construct ($ config );
6970
7071 if (!$ this ->enabled ()) {
71- return false ;
72+ throw new RedisSourceException ( __d ( ' redis ' , ' Extension is not loaded. ' )) ;
7273 }
7374
7475 $ this ->_connection = new Redis ();
Original file line number Diff line number Diff line change @@ -91,6 +91,7 @@ public function tearDown() {
9191 *
9292 * Tests that `connect` will never be called when redis extension is not loaded.
9393 *
94+ * @expectedException RedisSourceException
9495 * @return void
9596 */
9697 public function testConstructExtensionNotLoaded () {
You can’t perform that action at this time.
0 commit comments