/** * Set up test environment. */ public function setUp() { parent::setUp(); $container = new Container(['is_special' => true]); $this->pool->setContainer($container); $this->assertTrue($this->pool->hasContainer()); $this->assertInstanceOf(Container::class, $this->pool->getContainer()); }
/** * Set up test environment. */ public function setUp() { parent::setUp(); if ($this->connection->tableExists('writer_groups')) { $this->connection->dropTable('writer_groups'); } $create_table = $this->connection->execute("CREATE TABLE `writer_groups` (\n `writer_id` int(11) NOT NULL DEFAULT '0',\n `group_id` int(11) NOT NULL DEFAULT '0',\n PRIMARY KEY (`writer_id`, `group_id`)\n ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;"); $this->assertTrue($create_table); $this->connection->execute('INSERT INTO `writer_groups` (`writer_id`, `group_id`) VALUES (?, ?), (?, ?), (?, ?)', 1, 1, 2, 1, 3, 2); $this->assertEquals(2, $this->connection->count('writer_groups', ['group_id = ?', 1], '*')); $this->assertEquals(1, $this->connection->count('writer_groups', ['group_id = ?', 2], '*')); }
/** * {@inheritdoc} */ public function setUp() { parent::setUp(); $this->writer = $this->pool->getById(Writer::class, 1); $this->assertInstanceOf(Writer::class, $this->writer); }