protected function setUp() { $this->connectionFactory = $this->getMock('Magento\Setup\Module\ConnectionFactory', [], [], '', false); $this->connection = $this->getMockForAbstractClass('Magento\Framework\DB\Adapter\AdapterInterface'); $this->connectionFactory->expects($this->any())->method('create')->willReturn($this->connection); $this->dbValidator = new DbValidator($this->connectionFactory); }