• Home
  • Features
  • Pricing
  • Docs
  • Announcements
  • Sign In

elie29 / oci-driver / 20226421753

15 Dec 2025 09:06AM UTC coverage: 66.304% (-0.6%) from 66.923%
20226421753

push

github

Elie NEHME
🤖 Enhanced OCI driver with error handling, parameter validation, environment management, and added unit tests.

10 of 20 new or added lines in 5 files covered. (50.0%)

1 existing line in 1 file now uncovered.

183 of 276 relevant lines covered (66.3%)

7.08 hits per line

Source File
Press 'n' to go to next uncovered line, 'b' for previous

0.0
/src/OCI/Driver/Connection.php
1
<?php
2

3
declare(strict_types=1);
4

5
namespace Elie\OCI\Driver;
6

7
class Connection
8
{
9
    protected string $user;
10
    protected string $password;
11
    protected string $dbname;
12
    protected string $charset;
13

14
    /**
15
     * @param string $user The Oracle username.
16
     * @param string $password The password for username.
17
     * @param string $dbname Database connection string or name.
18
     * @param string $charset Database connection charset: default UTF8
19
     */
20
    public function __construct(string $user, string $password, string $dbname, string $charset = 'UTF8')
21
    {
22
        $this->user = $user;
×
23
        $this->password = $password;
×
24
        $this->dbname = $dbname;
×
25
        $this->charset = $charset;
×
26
    }
27

28
    /**
29
     * @return resource
30
     * @throws DriverException
31
     */
32
    public function connect()
33
    {
34
        $connection = @oci_pconnect($this->user, $this->password, $this->dbname, $this->charset);
×
35

36
        if (!$connection) {
×
NEW
37
            $error = oci_error();
×
NEW
38
            $message = sprintf(
×
NEW
39
                'Connection error for user %s to %s: %s',
×
NEW
40
                $this->user,
×
NEW
41
                $this->dbname,
×
NEW
42
                $error['message'] ?? 'Unknown error'
×
NEW
43
            );
×
UNCOV
44
            throw new DriverException($message);
×
45
        }
46

47
        return $connection;
×
48
    }
49
}
STATUS · Troubleshooting · Open an Issue · Sales · Support · CAREERS · ENTERPRISE · START FREE · SCHEDULE DEMO
ANNOUNCEMENTS · TWITTER · TOS & SLA · Supported CI Services · What's a CI service? · Automated Testing

© 2026 Coveralls, Inc