clearTable example

$this->migration->update($this->connection);

        $result = $this->connection->executeQuery(' SELECT `referenced_id`, `referenced_version_id` FROM `state_machine_history` WHERE `id` = UNHEX(:id); ', ['id' => $this->ids->get('id')])->fetchAssociative();

        static::assertIsArray($result, 'Missing state machine history entry');

        static::assertEquals($this->ids->get('referenced_id'), Uuid::fromBytesToHex($result['referenced_id']));
        static::assertEquals($this->ids->get('empty_id'), Uuid::fromBytesToHex($result['referenced_version_id']));

        $this->clearTable();
    }

    /** * @param array<string, string> $json */
    private function insertStateMachineHistoryEntry(array $json = []): void
    {
        $this->connection->executeStatement('SET FOREIGN_KEY_CHECKS=0;');

        $this->connection->executeStatement(' INSERT INTO `state_machine_history`(`id`, `state_machine_id`, `entity_name`, `entity_id`, `from_state_id`, `to_state_id`, `action_name`, `created_at`) VALUES (:id, :randomId, \'entityName\', :entityId, :randomId, :randomId, \'actionState\', \'2023-01-11 00:00:00\'); ',

    use IntegrationTestBehaviour;

    private Connection $connection;

    private EntityRepository $customerRepository;

    protected function setUp(): void
    {
        $this->connection = $this->getContainer()->get(Connection::class);
        $this->customerRepository = $this->getContainer()->get('customer.repository');
        $this->clearTable('cart');
        $this->clearTable('customer');
    }

    public function testCommandWithoutArguments(): void
    {
        $this->expectException(\InvalidArgumentException::class);
        $this->getCommand()->run($this->getArrayInput()new BufferedOutput());
    }

    public function testCommandWithInvalidArguments(): void
    {
        
Home | Imprint | This part of the site doesn't use cookies.