Skip to content

Commit

Permalink
scrutinizer fix unit test
Browse files Browse the repository at this point in the history
  • Loading branch information
jturbide committed Feb 21, 2024
1 parent 4ab5aa1 commit 5dcf083
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 6 deletions.
3 changes: 3 additions & 0 deletions .scrutinizer.yml
Original file line number Diff line number Diff line change
Expand Up @@ -46,9 +46,12 @@ build:
- composer require --dev phalcon/ide-stubs:5.6.1
- composer require --dev phpunit/phpunit
- composer require --dev squizlabs/php_codesniffer
- touch .env
tests:
stop_on_failure: false
override:
- command: ./bin/migration-list.sh
- command: ./bin/migration-run.sh
- command: php-scrutinizer-run --enable-security-analysis
- command: phpcs-run
- command: ./vendor/bin/phpunit
Expand Down
9 changes: 3 additions & 6 deletions tests/Unit/AbstractUnit.php
Original file line number Diff line number Diff line change
Expand Up @@ -54,15 +54,12 @@ public function getConfig(): Config
*/
protected function setUp(): void
{
defined('VENDOR_PATH') || define('VENDOR_PATH', (getenv('VENDOR_PATH') ? getenv('VENDOR_PATH') : dirname(__DIR__) . '/../vendor'));
defined('APP_NAMESPACE') || define('APP_NAMESPACE', (getenv('APP_NAMESPACE') ? getenv('APP_NAMESPACE') : 'Zemit'));
defined('APP_PATH') || define('APP_PATH', (getenv('APP_PATH') ? getenv('APP_PATH') : dirname(__DIR__) . '/../src'));

$rootDir = dirname(dirname(__DIR__)) . '/';
Env::setNames(['.env.testing']);

$loader = new Loader();
$loader->setFiles([VENDOR_PATH . '/autoload.php']);
$loader->setNamespaces([APP_NAMESPACE => APP_PATH]);
$loader->setFiles([$rootDir . '/vendor/autoload.php']);
$loader->setNamespaces(['Zemit' => $rootDir . '/src']);
$loader->setFileCheckingCallback(null);
$loader->register();

Expand Down

0 comments on commit 5dcf083

Please sign in to comment.