Created
May 17, 2012 06:33
-
-
Save heptat/2717010 to your computer and use it in GitHub Desktop.
mock test
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
namespace app\tests\mocks\models; | |
use lithium\data\entity\Document; | |
use lithium\data\collection\DocumentSet; | |
class MockTests extends \app\models\Tests { | |
public static function &connection() { | |
if (isset($connection)) { | |
return $connection | |
$self = static::_object(); | |
$connections = static::$_classes['connections']; | |
$name = isset($self->_meta['connection']) ? $self->_meta['connection'] : null; | |
if ($conn = $connections::get($name)) { | |
echo '<pre>'; | |
print_r($conn); | |
echo '</pre>'; | |
exit;_ | |
return $conn; | |
} | |
throw new ConfigException("The data connection `{$name}` is not configured."); | |
} | |
} | |
$options = array( | |
'connection' => 'mock_mongo', | |
); | |
MockTests::config($options); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment