Completed
Push — master ( 9c29a2...dadaa8 )
by Dave
03:24
created

MockeryPHPUnitIntegration   A

Complexity

Total Complexity 2

Size/Duplication

Total Lines 19
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 2

Test Coverage

Coverage 0%

Importance

Changes 1
Bugs 0 Features 0
Metric Value
wmc 2
c 1
b 0
f 0
lcom 0
cbo 2
dl 0
loc 19
ccs 0
cts 7
cp 0
rs 10

1 Method

Rating   Name   Duplication   Size   Complexity  
A assertPostConditions() 0 12 2
1
<?php
2
namespace Mockery\Adapter\Phpunit;
3
4
/**
5
 * Integrates Mockery into PHPUnit. Ensures Mockery expectations are verified
6
 * for each test and are included by the assertion counter.
7
 */
8
trait MockeryPHPUnitIntegration
9
{
10
    /**
11
     * Performs assertions shared by all tests of a test case. This method is
12
     * called before execution of a test ends and before the tearDown method.
13
     */
14
    protected function assertPostConditions()
15
    {
16
        parent::assertPostConditions();
17
18
        // Add Mockery expectations to assertion count.
19
        if (($container = \Mockery::getContainer()) !== null) {
20
            $this->addToAssertionCount($container->mockery_getExpectationCount());
21
        }
22
23
        // Verify Mockery expectations.
24
        \Mockery::close();
25
    }
26
}
27