Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 9 additions & 0 deletions .env.example
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,15 @@ LOG_LEVEL=debug
#DB_USERNAME=root
#DB_PASSWORD=

#DB_CONNECTION=oracle
#ORACLE_DB_HOST=127.0.0.1
#ORACLE_DB_PORT=1521
#ORACLE_DB_DATABASE=xe
#ORACLE_DB_USERNAME=system
#ORACLE_DB_PASSWORD=
#ORACLE_DB_CHARSET=AL32UTF8
#ORACLE_DB_PREFIX=

DB_CONNECTION=sqlite
#DB_HOST=127.0.0.1
#DB_PORT=3306
Expand Down
12 changes: 12 additions & 0 deletions config/database.php
Original file line number Diff line number Diff line change
Expand Up @@ -93,6 +93,18 @@
// 'trust_server_certificate' => env('DB_TRUST_SERVER_CERTIFICATE', 'false'),
],

'oracle' => [
'driver' => 'oracle',
'host' => env('ORACLE_DB_HOST', '127.0.0.1'),
'port' => env('ORACLE_DB_PORT', '1521'),
'database' => env('ORACLE_DB_DATABASE', 'xe'),
'username' => env('ORACLE_DB_USERNAME', 'system'),
'password' => env('ORACLE_DB_PASSWORD', ''),
'charset' => env('ORACLE_DB_CHARSET', 'AL32UTF8'),
'prefix' => env('ORACLE_DB_PREFIX', ''),
'prefix_indexes' => true,
],

],

/*
Expand Down
2 changes: 1 addition & 1 deletion tests/Unit/InventoryTotalCostTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,6 @@ public function test_total_cost_calculation(): void
return $item->total = $item->quantity * $item->unit_price;
});

$this->assertEquals($totalCost, $inventories->sum('total'));
$this->assertEquals(round($totalCost, 2), round($inventories->sum('total'), 2));
}
}
24 changes: 24 additions & 0 deletions tests/Unit/OracleDatabaseConfigTest.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
<?php

namespace Tests\Unit;

use Tests\TestCase;

class OracleDatabaseConfigTest extends TestCase
{
public function test_oracle_database_configuration_is_present(): void
{
$config = config('database.connections.oracle');

$this->assertNotNull($config);
$this->assertEquals('oracle', $config['driver']);
$this->assertEquals(env('ORACLE_DB_HOST', '127.0.0.1'), $config['host']);
$this->assertEquals(env('ORACLE_DB_PORT', '1521'), $config['port']);
$this->assertEquals(env('ORACLE_DB_DATABASE', 'xe'), $config['database']);
$this->assertEquals(env('ORACLE_DB_USERNAME', 'system'), $config['username']);
$this->assertEquals(env('ORACLE_DB_PASSWORD', ''), $config['password']);
$this->assertEquals(env('ORACLE_DB_CHARSET', 'AL32UTF8'), $config['charset']);
$this->assertEquals(env('ORACLE_DB_PREFIX', ''), $config['prefix']);
$this->assertTrue($config['prefix_indexes']);
}
}