diff --git a/application/classes/ORM.php b/application/classes/ORM.php deleted file mode 100755 index 357cde9c57..0000000000 --- a/application/classes/ORM.php +++ /dev/null @@ -1,22 +0,0 @@ - - * @package Ushahidi\Application\Models - * @copyright 2013 Ushahidi - * @license https://www.gnu.org/licenses/agpl-3.0.html GNU Affero General Public License Version 3 (AGPL3) - */ - -class ORM extends Kohana_ORM { - - /** - * Callback function to check if fk exists - */ - public function fk_exists($model_name, $field, $value) - { - return ORM::factory($model_name, $value)->loaded(); - } - -} diff --git a/application/classes/Unittest/Database/TestCase.php b/application/classes/Unittest/Database/TestCase.php deleted file mode 100644 index e333c48540..0000000000 --- a/application/classes/Unittest/Database/TestCase.php +++ /dev/null @@ -1,60 +0,0 @@ - - * @package Ushahidi\Unittest - * @copyright 2013 Ushahidi - * @license https://www.gnu.org/licenses/agpl-3.0.html GNU Affero General Public License Version 3 (AGPL3) - */ - -abstract class Unittest_Database_TestCase extends Kohana_Unittest_Database_TestCase { - - /** - * Creates a connection to the unittesting database - * Overriding to fix database type in DSN - must be lowercase - * - * @return PDO - */ - public function getConnection() - { - // Get the unittesting db connection - $config = Kohana::$config->load('database.'.$this->_database_connection); - - if($config['type'] !== 'pdo') - { - // Replace MySQLi with MySQL since MySQLi isn't valid for a DSN - $type = $config['type'] === 'MySQLi' ? 'MySQL' : $config['type']; - - $config['connection']['dsn'] = strtolower($type).':'. - 'host='.$config['connection']['hostname'].';'. - 'dbname='.$config['connection']['database']; - } - - $pdo = new PDO( - $config['connection']['dsn'], - $config['connection']['username'], - $config['connection']['password'] - ); - - return $this->createDefaultDBConnection($pdo, $config['connection']['database']); - } - - /** - * Returns the database operation executed in test setup. - * Overriding to fix Mysql 5.5 truncate errors - * - * @return PHPUnit_Extensions_Database_Operation_DatabaseOperation - */ - protected function getSetUpOperation() - { - //return PHPUnit_Extensions_Database_Operation_Factory::CLEAN_INSERT(); - $cascadeTruncates = TRUE; - return new PHPUnit_Extensions_Database_Operation_Composite(array( - new Unittest_Database_Operation_MySQL55Truncate($cascadeTruncates), - PHPUnit_Extensions_Database_Operation_Factory::INSERT() - )); - } - -} diff --git a/phpunit.xml.dist b/phpunit.xml.dist index dad53ef237..428ef3263d 100644 --- a/phpunit.xml.dist +++ b/phpunit.xml.dist @@ -7,6 +7,13 @@ ./tests/ + + + ./application/classes + ./src + ./plugins/*/classes + + diff --git a/src/App/FilesystemAdapter/Rackspace.php b/src/App/FilesystemAdapter/Rackspace.php index 6bd8f775a4..7c732f28e4 100644 --- a/src/App/FilesystemAdapter/Rackspace.php +++ b/src/App/FilesystemAdapter/Rackspace.php @@ -12,7 +12,7 @@ namespace Ushahidi\App\FilesystemAdapter; use OpenCloud\OpenStack; -use OpenCloud\Rackspace; +use OpenCloud\Rackspace as OCRackspace; use League\Flysystem\Filesystem; use League\Flysystem\Rackspace\RackspaceAdapter as Adapter; use Ushahidi\Core\Tool\FilesystemAdapter; @@ -29,7 +29,7 @@ public function __construct($config) public function getAdapter() { - $client = new Rackspace(Rackspace::US_IDENTITY_ENDPOINT, array( + $client = new OCRackspace(OCRackspace::US_IDENTITY_ENDPOINT, array( 'username' => $this->config['username'], 'apiKey' => $this->config['apiKey'], )); diff --git a/src/Core/Usecase/Post/StatsPostRepository.php b/src/Core/Usecase/Post/StatsPostRepository.php index 2e0077f9ca..8311afe157 100644 --- a/src/Core/Usecase/Post/StatsPostRepository.php +++ b/src/Core/Usecase/Post/StatsPostRepository.php @@ -21,5 +21,5 @@ interface StatsPostRepository * @param SearchData $search * @return Array */ - public function getGroupedTotals(SearchData $search) + public function getGroupedTotals(SearchData $search); }