for testing and deploying your application
for finding and fixing issues
for empowering human code reviews
<?php
namespace Tests\Queryr\EntityStore;
use Doctrine\DBAL\Schema\AbstractSchemaManager;
use Queryr\EntityStore\EntityStoreConfig;
use Queryr\EntityStore\EntityStoreInstaller;
use Tests\Queryr\EntityStore\Fixtures\TestFixtureFactory;
/**
* @covers Queryr\EntityStore\EntityStoreInstaller
*
* @licence GNU GPL v2+
* @author Jeroen De Dauw < [email protected] >
*/
class EntityStoreInstallerTest extends \PHPUnit_Framework_TestCase {
* @var EntityStoreInstaller
private $storeInstaller;
* @var AbstractSchemaManager
private $schemaManager;
public function setUp() {
$connection = TestFixtureFactory::newInstance()->newConnection();
$this->schemaManager = $connection->getSchemaManager();
$this->storeInstaller = new EntityStoreInstaller(
$this->schemaManager,
new EntityStoreConfig( 'kittens_' )
);
}
public function testInstallationAndRemoval() {
$this->storeInstaller->install();
$this->assertTrue( $this->schemaManager->tablesExist( 'kittens_items' ) );
'kittens_items'
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_properties' ) );
'kittens_properties'
$this->storeInstaller->uninstall();
$this->assertFalse( $this->schemaManager->tablesExist( 'kittens_items' ) );
$this->assertFalse( $this->schemaManager->tablesExist( 'kittens_properties' ) );
public function testStoresPage() {
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: