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

MockeryPHPUnitIntegration::assertPostConditions()   A

Complexity

Conditions 2
Paths 2

Size

Total Lines 12
Code Lines 5

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 0
CRAP Score 6

Importance

Changes 1
Bugs 0 Features 0
Metric Value
dl 0
loc 12
ccs 0
cts 7
cp 0
rs 9.4286
c 1
b 0
f 0
cc 2
eloc 5
nc 2
nop 0
crap 6
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