Completed
Push — master ( 9de5b8...ddab96 )
by Matteo
03:46
created

ErrorTest   A

Complexity

Total Complexity 2

Size/Duplication

Total Lines 20
Duplicated Lines 0 %

Coupling/Cohesion

Components 1
Dependencies 2

Importance

Changes 1
Bugs 0 Features 1
Metric Value
wmc 2
c 1
b 0
f 1
lcom 1
cbo 2
dl 0
loc 20
rs 10

2 Methods

Rating   Name   Duplication   Size   Complexity  
A testErrno() 0 8 1
A testError() 0 8 1
1
<?php
2
3
class ErrorTest extends BridgeTestCase
0 ignored issues
show
Coding Style Compatibility introduced by
PSR1 recommends that each class must be in a namespace of at least one level to avoid collisions.

You can fix this by adding a namespace to your class:

namespace YourVendor;

class YourClass { }

When choosing a vendor namespace, try to pick something that is not too generic to avoid conflicts with other libraries.

Loading history...
4
{
5
    public function testErrno()
6
    {
7
        $this->bridge->query('SELECT * FROM test_table');
8
        $this->assertEquals(0, $this->bridge->errno());
9
        
10
        $this->bridge->query('SELECT * FROM nowhere');
11
        $this->assertEquals(1146, $this->bridge->errno());
12
    }
13
14
    public function testError()
15
    {
16
        $this->bridge->query('SELECT * FROM test_table');
17
        $this->assertEquals("", $this->bridge->error());
18
19
        $this->bridge->query('SELECT * FROM nowhere');
20
        $this->assertContains("doesn't exist", $this->bridge->error());
21
    }
22
}