PHP code example of matthiasnoback / doctrine-dbal-test-service-provider
1. Go to this page and download the library: Download matthiasnoback/doctrine-dbal-test-service-provider library. Choose the download type require. 2. Extract the ZIP file and open the index.php. 3. Add this code to the index.php.
<?php
require_once('vendor/autoload.php');
/* Start to develop here. Best regards https://php-download.com/ */
matthiasnoback / doctrine-dbal-test-service-provider example snippets
use Noback\PHPUnitTestServiceContainer\PHPUnit\TestCaseWithDoctrineDbalConnection;
use Doctrine\DBAL\Schema\Schema;
final class StorageTest
{
use TestCaseWithDoctrineDbalConnection;
/**
* @test
*/
public function something()
{
$connection = $this->getConnection();
$connection->insert('some_table', array('some_column' => 'value'));
...
}
protected function createSchema()
{
$schema = new Schema();
$table = $schema->createTable('some_table');
$table->addColumn('some_column', 'string');
return $schema;
}
}