1
0
mirror of https://github.com/invoiceninja/invoiceninja.git synced 2024-09-19 16:01:34 +02:00

Fix for travis tests

This commit is contained in:
Hillel Coren 2016-05-04 09:53:43 +03:00
parent 9d1c49ff14
commit 2fcb1d66a5
4 changed files with 9 additions and 3 deletions

View File

@ -45,7 +45,8 @@ before_script:
- php artisan key:generate --no-interaction
- sed -i 's/APP_ENV=production/APP_ENV=development/g' .env
- sed -i 's/APP_DEBUG=false/APP_DEBUG=true/g' .env
- sed -i 's/REQUIRE_HTTPS=false/NINJA_DEV=true/g' .env
- sed -i '$a NINJA_DEV=true' .env
- sed -i '$a TRAVIS=true' .env
# create the database and user
- mysql -u root -e "create database IF NOT EXISTS ninja;"
- mysql -u root -e "GRANT ALL PRIVILEGES ON ninja.* To 'ninja'@'localhost' IDENTIFIED BY 'ninja'; FLUSH PRIVILEGES;"

View File

@ -39,7 +39,7 @@ class Handler extends ExceptionHandler {
return false;
}
if (Utils::isNinja()) {
if (Utils::isNinja() && ! Utils::isTravis()) {
Utils::logError(Utils::getErrorString($e));
return false;
} else {

View File

@ -51,6 +51,11 @@ class Utils
return php_sapi_name() == 'cli';
}
public static function isTravis()
{
return env('TRAVIS') == 'true';
}
public static function isNinja()
{
return self::isNinjaProd() || self::isNinjaDev();

View File

@ -7,7 +7,7 @@ class ProductTransformer extends EntityTransformer
{
public function transform(Product $product)
{
return array_merge($this->getDefaults(), [
return array_merge($this->getDefaults($product), [
'id' => (int) $product->public_id,
'product_key' => $product->product_key,
'notes' => $product->notes,