This commit is contained in:
KNaveenraj-ladybird
2023-09-12 18:19:44 +05:30
committed by RafficMohammed
parent 6cebe281e9
commit 06fd163c60
5 changed files with 104 additions and 35 deletions

View File

@@ -63,7 +63,7 @@ Route::prefix('api/v1')->group(function () {
/*
* FCM token response
*/
Route::post('fcmtoken', [Common\PushNotificationController::class, 'fcmToken'])->name('fcmtoken');
//Route::post('fcmtoken', [Common\PushNotificationController::class, 'fcmToken'])->name('fcmtoken');
});
/*
* ================================================================================================

59
phpunit.xml Normal file → Executable file
View File

@@ -1,36 +1,27 @@
<?xml version="1.0" encoding="UTF-8"?>
<phpunit backupGlobals="false"
backupStaticAttributes="false"
bootstrap="bootstrap/autoload.php"
colors="true"
convertErrorsToExceptions="true"
convertNoticesToExceptions="true"
convertWarningsToExceptions="true"
processIsolation="false"
stopOnFailure="false">
<testsuites>
<testsuite name="all">
<directory>./tests/</directory>
</testsuite>
<testsuite name="unit">
<directory>./tests/unit</directory>
</testsuite>
</testsuites>
<filter>
<whitelist addUncoveredFilesFromWhitelist="true">
<directory suffix=".php">app/</directory>
</whitelist>
</filter>
<php>
<env name="APP_ENV" value="testing"/>
<env name="DB_CONNECTION" value="testing"/>
<env name="DB_DATABASE" value="testing_db"/>
<env name="CACHE_DRIVER" value="array"/>
<env name="SESSION_DRIVER" value="array"/>
<env name="QUEUE_CONNECTION" value="sync"/>
<env name="MAIL_MAILER" value="mail"/>
<env name="APP_URL" value="http://localhost:8000"/>
<env name="DB_DATABASE" value="testing_db"/>
<env name="DB_INSTALL" value="1"/>
</php>
<phpunit xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" backupGlobals="false" backupStaticAttributes="false" bootstrap="bootstrap/autoload.php" colors="true" convertErrorsToExceptions="true" convertNoticesToExceptions="true" convertWarningsToExceptions="true" processIsolation="false" stopOnFailure="false" xsi:noNamespaceSchemaLocation="https://schema.phpunit.de/9.3/phpunit.xsd">
<coverage includeUncoveredFiles="true">
<include>
<directory suffix=".php">app/</directory>
</include>
</coverage>
<testsuites>
<testsuite name="feature">
<directory>tests/Feature</directory>
</testsuite>
<testsuite name="unit">
<directory>tests/Unit</directory>
</testsuite>
</testsuites>
<php>
<env name="APP_ENV" value="testing"/>
<!-- <env name="DB_CONNECTION" value="testing"/>
<env name="DB_DATABASE" value="testing_db"/> -->
<env name="CACHE_DRIVER" value="array"/>
<env name="SESSION_DRIVER" value="array"/>
<env name="QUEUE_CONNECTION" value="sync"/>
<env name="MAIL_MAILER" value="mail"/>
<env name="APP_URL" value="http://localhost:8000"/>
<env name="DB_INSTALL" value="1"/>
</php>
</phpunit>

36
phpunit.xml.bak Executable file
View File

@@ -0,0 +1,36 @@
<?xml version="1.0" encoding="UTF-8"?>
<phpunit backupGlobals="false"
backupStaticAttributes="false"
bootstrap="bootstrap/autoload.php"
colors="true"
convertErrorsToExceptions="true"
convertNoticesToExceptions="true"
convertWarningsToExceptions="true"
processIsolation="false"
stopOnFailure="false">
<testsuites>
<testsuite name="all">
<directory>./tests/</directory>
</testsuite>
<testsuite name="unit">
<directory>./tests/unit</directory>
</testsuite>
</testsuites>
<filter>
<whitelist addUncoveredFilesFromWhitelist="true">
<directory suffix=".php">app/</directory>
</whitelist>
</filter>
<php>
<env name="APP_ENV" value="testing"/>
<env name="DB_CONNECTION" value="testing"/>
<env name="DB_DATABASE" value="testing_db"/>
<env name="CACHE_DRIVER" value="array"/>
<env name="SESSION_DRIVER" value="array"/>
<env name="QUEUE_CONNECTION" value="sync"/>
<env name="MAIL_MAILER" value="mail"/>
<env name="APP_URL" value="http://localhost:8000"/>
<env name="DB_DATABASE" value="testing_db"/>
<env name="DB_INSTALL" value="1"/>
</php>
</phpunit>

23
tests/Feature/RouteTest.php Executable file
View File

@@ -0,0 +1,23 @@
<?php
namespace Tests\Feature;
use Illuminate\Foundation\Testing\RefreshDatabase;
use Illuminate\Foundation\Testing\WithFaker;
use Tests\TestCase;
class RouteTest extends TestCase
{
/**
* A basic feature test example.
*
* @return void
*/
public function test_example()
{
$response = $this->get('/');
$response->assertStatus(200);
}
}

View File

@@ -0,0 +1,19 @@
<?php
namespace Tests\Unit;
use Tests\TestCase;
class ArtisanCommandTest extends TestCase
{
/**
* A basic test example.
*
* @return void
*/
public function testRouteListCommand()
{
$this->artisan('route:list')
->assertExitCode(0);
}
}