. */ namespace OCA\News\Tests\Unit\Db; use Doctrine\DBAL\Driver\PDOStatement; use OCP\IDBConnection; use PHPUnit\Framework\MockObject\MockObject; use PHPUnit\Framework\TestCase; /** * Simple utility class for testing mappers */ abstract class MapperTestUtility extends TestCase { /** * @var MockObject|IDBConnection */ protected $db; /** * @var MockObject|PDOStatement */ protected $query; /** * Run this function before the actual test to either set or initialize the * db. After this the db can be accessed by using $this->db */ protected function setUp(): void { parent::setUp(); $this->db = $this->getMockBuilder(IDBConnection::class) ->disableOriginalConstructor() ->getMock(); $this->query = $this->getMockBuilder(\PDOStatement::class) ->getMock(); } }