We could not synchronize checks via GitHub's checks API since Scrutinizer's GitHub App is not installed for this repository.
| Total Complexity | 3 |
| Total Lines | 33 |
| Duplicated Lines | 0 % |
| Changes | 2 | ||
| Bugs | 0 | Features | 0 |
| 1 | <?php |
||
| 13 | class MySqlDatabaseTest extends TestCase { |
||
| 14 | private Container $container; |
||
| 15 | /** |
||
| 16 | * @var mysqli|MockObject |
||
| 17 | */ |
||
| 18 | private mysqli $mysql; |
||
| 19 | |||
| 20 | protected function setUp(): void { |
||
| 21 | DiContainer::initializeContainer(); |
||
| 22 | $this->container = DiContainer::getContainer(); |
||
| 23 | $this->mysql = $this->createMock(mysqli::class); |
||
| 24 | // Replace the factory definition for mysqli object with our mock, so when |
||
| 25 | // requesting a mysqli instance, it will always return a mock for this test |
||
| 26 | $this->container->set(mysqli::class, $this->mysql); |
||
| 27 | } |
||
| 28 | |||
| 29 | public function test__construct_happy_path() { |
||
| 30 | $this->mysql |
||
| 31 | ->expects(self::once()) |
||
|
|
|||
| 32 | ->method("character_set_name") |
||
| 33 | ->willReturn("utf8"); |
||
| 34 | $mysqlDatabase = $this->container->get(MySqlDatabase::class); |
||
| 35 | $this->assertNotNull($mysqlDatabase); |
||
| 36 | } |
||
| 37 | |||
| 38 | public function test__construct_invalid_character_set_throws_exception() { |
||
| 46 | } |
||
| 47 | } |
||
| 48 |
This check looks for calls to methods that do not seem to exist on a given type. It looks for the method on the type itself as well as in inherited classes or implemented interfaces.
This is most likely a typographical error or the method has been renamed.