for testing and deploying your application
for finding and fixing issues
for empowering human code reviews
<?php
namespace Tests\Queryr\TermStore;
use Doctrine\DBAL\DriverManager;
use Doctrine\DBAL\Schema\AbstractSchemaManager;
use PHPUnit\Framework\TestCase;
use Queryr\TermStore\TermStoreConfig;
use Queryr\TermStore\TermStoreInstaller;
/**
* @covers \Queryr\TermStore\TermStoreInstaller
*
* @licence GNU GPL v2+
* @author Jeroen De Dauw < [email protected] >
*/
class TermStoreInstallerTest extends TestCase {
* @var TermStoreInstaller
private $storeInstaller;
* @var AbstractSchemaManager
private $schemaManager;
public function setUp() {
$connection = DriverManager::getConnection( array(
'driver' => 'pdo_sqlite',
'memory' => true,
) );
$this->schemaManager = $connection->getSchemaManager();
$this->storeInstaller = new TermStoreInstaller( $this->schemaManager, new TermStoreConfig( 'kittens_' ) );
}
public function testInstallationAndRemoval() {
$this->storeInstaller->install();
$this->assertTrue( $this->schemaManager->tablesExist( 'kittens_labels' ) );
'kittens_labels'
string
array
It seems like the type of the argument is not accepted by the function/method which you are calling.
In some cases, in particular if PHP’s automatic type-juggling kicks in this might be fine. In other cases, however this might be a bug.
We suggest to add an explicit type cast like in the following example:
function acceptsInteger($int) { } $x = '123'; // string "123" // Instead of acceptsInteger($x); // we recommend to use acceptsInteger((integer) $x);
$this->assertTrue( $this->schemaManager->tablesExist( 'kittens_aliases' ) );
'kittens_aliases'
$this->storeInstaller->uninstall();
$this->assertFalse( $this->schemaManager->tablesExist( 'kittens_labels' ) );
$this->assertFalse( $this->schemaManager->tablesExist( 'kittens_aliases' ) );
public function testStoresPage() {
$this->assertTrue( true );
It seems like the type of the argument is not accepted by the function/method which you are calling.
In some cases, in particular if PHP’s automatic type-juggling kicks in this might be fine. In other cases, however this might be a bug.
We suggest to add an explicit type cast like in the following example: