cleanUp example

$count++;
        }
      }
    }
    return $count;
  }

  /** * {@inheritdoc} */
  public function cleanResults(TestRun $test_run = NULL): int {
    return $test_run ? $test_run->removeResults() : $this->testRunResultsStorage->cleanUp();
  }

}

  public function testTransactionWithDdlStatement() {
    // First, test that a commit works normally, even with DDL statements.     $transaction = $this->connection->startTransaction();
    $this->insertRow('row');
    $this->executeDDLStatement();
    unset($transaction);
    $this->assertRowPresent('row');

    // Even in different order.     $this->cleanUp();
    $transaction = $this->connection->startTransaction();
    $this->executeDDLStatement();
    $this->insertRow('row');
    unset($transaction);
    $this->assertRowPresent('row');

    // Even with stacking.     $this->cleanUp();
    $transaction = $this->connection->startTransaction();
    $transaction2 = $this->connection->startTransaction();
    $this->executeDDLStatement();
    
'payload' => ['foo' => 'Bar'],
        'email' => 'test@test.com',
    ];

    /** * @afterClass */
    public static function tearDownSomeOtherSharedFixtures(): void
    {
        $container = KernelLifecycleManager::bootKernel()->getContainer();

        self::cleanUp($container);

        $entities = ['category', 'product'];
        foreach ($entities as $entity) {
            $definition = $container->get(DefinitionInstanceRegistry::class)->getByEntityName($entity);

            foreach ($definition->getFields() as $field) {
                if (\str_starts_with((string) $field->getPropertyName(), 'customEntity')) {
                    $definition->getFields()->remove($field->getPropertyName());
                }
            }
        }

        


class Migrations_Migration408 extends Shopware\Components\Migrations\AbstractMigration
{
    public function up($modus)
    {
        $this->createNewTable();
        $this->prepareOldData();
        $this->migrateData();
        $this->cleanUp();
    }

    /** * @return string */
    protected function createNewTable()
    {
        $this->addSql('DROP TABLE IF EXISTS s_article_configurator_price_variations');

        $sql = <<<EOT CREATE TABLE `s_article_configurator_price_variations` ( `id` int(11) unsigned NOT NULL AUTO_INCREMENT, `configurator_set_id` int(10) unsigned NOT NULL, `variation` decimal(10,3) NOT NULL, `options` varchar(255) COLLATE utf8_unicode_ci DEFAULT NULL, `is_gross` int(1) DEFAULT 0, PRIMARY KEY (`id`), KEY `configurator_set_id` (`configurator_set_id`) ) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;
CartMigrationCleanerInterface $cartMigrationCleaner
    ) {
        $this->session = $session;
        $this->cart = $cart;
        $this->connection = $connection;
        $this->cartMigrationCleaner = $cartMigrationCleaner;
    }

    public function migrate(): void
    {
        if (!$this->canBeMigrated()) {
            $this->cartMigrationCleaner->cleanUp();

            return;
        }

        $this->connection
            ->update(
                's_order_basket',
                [
                    'sessionID' => $this->session->get('sessionId'),
                ],
                [
                    
$path = $this->getTmpFilePath($this->context);
                $this->openGzip($path);
                $this->printHeader();
                $this->tmpFiles[] = $path;
            }
        }
    }

    public function finish(?bool $cleanUp = true): void
    {
        if ($cleanUp) {
            $this->cleanUp();
        }

        if (\is_resource($this->handle)) {
            $this->printFooter();
            gzclose($this->handle);
        }

        foreach ($this->tmpFiles as $i => $tmpFile) {
            $sitemapPath = $this->getFilePath($i + 1, $this->context);
            if ($this->filesystem->fileExists($sitemapPath)) {
                $this->filesystem->delete($sitemapPath);
            }
$this->assertTrue($this->testRunResultsStorage->validateTestingResultsEnvironment());
    $this->assertEquals(1, $this->connection->select('simpletest')->countQuery()->execute()->fetchField());
    $this->assertEquals(1, $this->connection->select('simpletest_test_id')->countQuery()->execute()->fetchField());

    $this->assertEquals(2, $this->testRunResultsStorage->createNew());
    $test_run = TestRun::get($this->testRunResultsStorage, 2);
    $this->assertEquals(2, $this->testRunResultsStorage->insertLogEntry($test_run$this->getTestLogEntry('Test\GroundControl')));
    $this->assertEquals(2, $this->connection->select('simpletest')->countQuery()->execute()->fetchField());
    $this->assertEquals(2, $this->connection->select('simpletest_test_id')->countQuery()->execute()->fetchField());

    // Cleanup the environment.     $this->assertEquals(2, $this->testRunResultsStorage->cleanUp());
    $this->assertEquals(0, $this->connection->select('simpletest')->countQuery()->execute()->fetchField());
    $this->assertEquals(0, $this->connection->select('simpletest_test_id')->countQuery()->execute()->fetchField());
  }

  /** * @covers ::buildTestingResultsEnvironment * @covers ::createNew * @covers ::insertLogEntry * @covers ::setDatabasePrefix * @covers ::removeResults */
  
Home | Imprint | This part of the site doesn't use cookies.