Fixes for tests + remove swoole

This commit is contained in:
David Bomba 2020-10-22 21:14:14 +11:00
parent 52a80c458e
commit c8e2d94b3f
14 changed files with 34 additions and 95 deletions

View File

@ -207,7 +207,7 @@ class BaseController extends Controller
$query->whereNotNull('updated_at')->with('documents');
},
'company.clients' => function ($query) use ($updated_at) {
$query->where('clients.updated_at', '>=', $updated_at)->with('contacts.company', 'gateway_tokens','documents','company');
$query->where('clients.updated_at', '>=', $updated_at)->with('contacts.company', 'gateway_tokens','documents');
},
'company.company_gateways' => function ($query) {
$query->whereNotNull('updated_at');

View File

@ -52,7 +52,7 @@ class Kernel extends HttpKernel
],
'api' => [
'throttle:60,1',
'throttle:300,1',
'bindings',
'query_logging',
\App\Http\Middleware\Cors::class,
@ -74,7 +74,7 @@ class Kernel extends HttpKernel
\App\Http\Middleware\QueryLogging::class,
],
'shop' => [
'throttle:60,1',
'throttle:120,1',
'bindings',
'query_logging',
],

View File

@ -54,6 +54,7 @@ class QueryLogging
// if($count > 50)
// Log::info($queries);
}
}

View File

@ -201,7 +201,7 @@ class AuthorizeCreditCard
private function processFailedResponse($data, $request)
{
//dd($data);
info(print_r($data, 1));
// info(print_r($data, 1));
}
private function formatGatewayResponse($data, $vars)

View File

@ -293,7 +293,7 @@ trait PdfMakerUtilities
$this->document->getElementById('repeat-content')->appendChild($clone);
}
info($this->data['options']);
// info($this->data['options']);
if (
$header = $this->document->getElementById('header') &&

View File

@ -59,7 +59,6 @@
"spatie/browsershot": "^3.37",
"staudenmeir/eloquent-has-many-deep": "^1.11",
"stripe/stripe-php": "^7.50",
"swooletw/laravel-swoole": "^2.6",
"turbo124/beacon": "^1",
"turbo124/laravel-gmail": "^5.0",
"webpatser/laravel-countries": "dev-master#75992ad"

91
composer.lock generated
View File

@ -4,7 +4,7 @@
"Read more about it at https://getcomposer.org/doc/01-basic-usage.md#installing-dependencies",
"This file is @generated automatically"
],
"content-hash": "08ae0ebd522fae2599454303710f08b1",
"content-hash": "152c174ecc48f87a2c7fd00335c6fc86",
"packages": [
{
"name": "asgrim/ofxparser",
@ -3879,16 +3879,16 @@
},
{
"name": "nesbot/carbon",
"version": "2.41.3",
"version": "2.41.4",
"source": {
"type": "git",
"url": "https://github.com/briannesbitt/Carbon.git",
"reference": "e148788eeae9b9b7b87996520358b86faad37b52"
"reference": "6571aec754a648ef476a8d8f57993f7bc965afe4"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/briannesbitt/Carbon/zipball/e148788eeae9b9b7b87996520358b86faad37b52",
"reference": "e148788eeae9b9b7b87996520358b86faad37b52",
"url": "https://api.github.com/repos/briannesbitt/Carbon/zipball/6571aec754a648ef476a8d8f57993f7bc965afe4",
"reference": "6571aec754a648ef476a8d8f57993f7bc965afe4",
"shasum": ""
},
"require": {
@ -3964,7 +3964,7 @@
"type": "tidelift"
}
],
"time": "2020-10-12T20:36:09+00:00"
"time": "2020-10-22T07:28:05+00:00"
},
{
"name": "nikic/php-parser",
@ -6497,85 +6497,6 @@
],
"time": "2019-11-12T09:31:26+00:00"
},
{
"name": "swooletw/laravel-swoole",
"version": "v2.6.68",
"source": {
"type": "git",
"url": "https://github.com/swooletw/laravel-swoole.git",
"reference": "4167206bfbaea752264c814cac5c2172e72a400a"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/swooletw/laravel-swoole/zipball/4167206bfbaea752264c814cac5c2172e72a400a",
"reference": "4167206bfbaea752264c814cac5c2172e72a400a",
"shasum": ""
},
"require": {
"illuminate/console": "~5.4|~6.0|~7.0|~8.0",
"illuminate/contracts": "~5.4|~6.0|~7.0|~8.0",
"illuminate/http": "~5.4|~6.0|~7.0|~8.0",
"illuminate/support": "~5.4|~6.0|~7.0|~8.0",
"php": "^7.2",
"predis/predis": "^1.1"
},
"require-dev": {
"codedungeon/phpunit-result-printer": "^0.14.0",
"laravel/lumen-framework": "~5.4|~6.0|~7.0|~8.0",
"mockery/mockery": "~1.0",
"php-coveralls/php-coveralls": "^2.1",
"php-mock/php-mock": "^2.0",
"phpunit/php-code-coverage": "^6.1",
"phpunit/phpunit": "^7.5",
"swoole/ide-helper": "@dev"
},
"type": "library",
"extra": {
"laravel": {
"providers": [
"SwooleTW\\Http\\LaravelServiceProvider"
],
"aliases": {
"Server": "SwooleTW\\Http\\Server\\Facades\\Server",
"Table": "SwooleTW\\Http\\Server\\Facades\\Table",
"Room": "SwooleTW\\Http\\Websocket\\Facades\\Room",
"Websocket": "SwooleTW\\Http\\Websocket\\Facades\\Websocket"
}
}
},
"autoload": {
"files": [
"src/Server/helpers.php"
],
"psr-4": {
"SwooleTW\\Http\\": "src"
}
},
"notification-url": "https://packagist.org/downloads/",
"license": [
"MIT"
],
"authors": [
{
"name": "Albert Chen",
"email": "albert@unisharp.com"
},
{
"name": "Huang Yi",
"email": "coodeer@163.com"
}
],
"description": "High performance HTTP server based on Swoole. Speed up your Laravel and Lumen applications.",
"keywords": [
"http",
"laravel",
"lumen",
"performance",
"server",
"swoole"
],
"time": "2020-09-21T10:06:50+00:00"
},
{
"name": "symfony/console",
"version": "v5.1.7",

View File

@ -181,7 +181,6 @@ return [
App\Providers\MultiDBProvider::class,
App\Providers\ClientPortalServiceProvider::class,
App\Providers\NinjaTranslationServiceProvider::class,
SwooleTW\Http\LaravelServiceProvider::class,
],

View File

@ -14,6 +14,7 @@ use Faker\Factory;
use Illuminate\Foundation\Testing\DatabaseTransactions;
use Tests\MockAccountData;
use Tests\TestCase;
use Illuminate\Routing\Middleware\ThrottleRequests;
/**
* @test
@ -31,6 +32,11 @@ class ActivityApiTest extends TestCase
$this->makeTestData();
$this->withoutMiddleware(
ThrottleRequests::class
);
}
public function testActivityGet()

View File

@ -516,7 +516,8 @@ class ClientTest extends TestCase
$response->assertStatus(200);
$arr = $response->json();
info($arr);
$this->client = Client::find($this->decodePrimaryKey($arr['data']['id']));
$this->client->fresh();

View File

@ -172,6 +172,6 @@ class CompanyGatewayResolutionTest extends TestCase
$this->assertEquals(4, count($this->cg->driver($this->client)->gatewayTypes()));
info(print_r($this->client->getPaymentMethods(10),1));
// info(print_r($this->client->getPaymentMethods(10),1));
}
}

View File

@ -29,6 +29,7 @@ use Illuminate\Support\Facades\Log;
use Illuminate\Support\Facades\Session;
use Tests\MockAccountData;
use Tests\TestCase;
use Illuminate\Routing\Middleware\ThrottleRequests;
/**
* @test
@ -51,6 +52,11 @@ class PaymentTermsApiTest extends TestCase
$this->faker = \Faker\Factory::create();
Model::reguard();
$this->withoutMiddleware(
ThrottleRequests::class
);
}
public function testPaymentTermsGet()

View File

@ -1295,7 +1295,7 @@ $contact = ClientContact::factory()->create([
$payment = Payment::find($this->decodePrimaryKey($payment_id))->first();
info($payment);
// info($payment);
$this->assertNotNull($payment);
$this->assertNotNull($payment->invoices());

View File

@ -13,6 +13,7 @@ namespace Tests\Feature;
use Illuminate\Foundation\Testing\DatabaseTransactions;
use Tests\MockAccountData;
use Tests\TestCase;
use Illuminate\Routing\Middleware\ThrottleRequests;
/**
* @test
@ -28,6 +29,11 @@ class PingTest extends TestCase
parent::setUp();
$this->makeTestData();
$this->withoutMiddleware(
ThrottleRequests::class
);
}
public function testPingEndPoint()