Issues (13)

Mezon/PdoCrud/Tests/Utils.php (1 issue)

Severity
1
<?php
2
namespace Mezon\PdoCrud\Tests;
3
4
use PHPUnit\Framework\TestCase;
5
use Mezon\PdoCrud\PdoCrud;
6
7
/**
8
 * Utilities for unit-tests
9
 */
10
class Utils
11
{
12
13
    /**
14
     * List of methods to be mocked
15
     * 
16
     * @var array
17
     */
18
    public static $mockingMethods = [
19
        'query',
20
        'processQueryError',
21
        'lastInsertId'
22
    ];
23
24
    /**
25
     * Method returns mock of the PdoCrud object
26
     * Mocked methods: query, processQueryError, lastInsertId
27
     *
28
     * @param \PHPUnit\Framework\TestCase $test
29
     * @return object
30
     */
31
    public static function getMock(TestCase $test): object
32
    {
33
        return $test->getMockBuilder(PdoCrud::class)
0 ignored issues
show
Deprecated Code introduced by
The function PHPUnit\Framework\MockOb...ckBuilder::setMethods() has been deprecated: https://github.com/sebastianbergmann/phpunit/pull/3687 ( Ignorable by Annotation )

If this is a false-positive, you can also ignore this issue in your code via the ignore-deprecated  annotation

33
        return /** @scrutinizer ignore-deprecated */ $test->getMockBuilder(PdoCrud::class)

This function has been deprecated. The supplier of the function has supplied an explanatory message.

The explanatory message should give you some clue as to whether and when the function will be removed and what other function to use instead.

Loading history...
34
            ->setMethods(self::$mockingMethods)
35
            ->disableOriginalConstructor()
36
            ->getMock();
37
    }
38
}
39