public function ensureTables(array $fixtures) {
		$connection = $this->getConnection();

		if (static::$invoked) {
			// When exceptions are encountered we try to avoid loops
			return;
		}
		static::$invoked = true;

		$schema = $connection->getSchemaCollection();
		$existing = $schema->listTables();

		foreach ($fixtures as $name) {
			$class = App::className($name, 'Test/Fixture', 'Fixture');
			if ($class === false) {
				throw new RuntimeException("Unknown fixture '$name'.");
			}
			/** @var \Cake\TestSuite\Fixture\TestFixture $fixture */
			$fixture = new $class($this->getConnection()->configName());
			$table = $fixture->table;
			if (in_array($table, $existing, true)) {
				continue;
			}
			$fixture->create($connection);
		}
	}
public function ensureTables(array $fixtures) {
		$connection = $this->getConnection();

		if (static::$invoked) {
			// When exceptions are encountered we try to avoid loops
			return;
		}
		static::$invoked = true;

		$schema = $connection->getSchemaCollection();
		$existing = $schema->listTables();

		foreach ($fixtures as $name) {
			$class = App::className($name, 'Test/Fixture', 'Fixture');
			if ($class === false) {
				throw new RuntimeException("Unknown fixture '$name'.");
			}
			/** @var \Cake\TestSuite\Fixture\TestFixture $fixture */
			$fixture = new $class($this->getConnection()->configName());
			$table = $fixture->table;
			if (in_array($table, $existing, true)) {
				continue;
			}
			$fixture->create($connection);
		}
	}
public function ensureTables ( array $ fixtures ) { $ connection = $ this -> getConnection ( ) ; if ( static :: $ invoked ) { // When exceptions are encountered we try to avoid loops return ; } static :: $ invoked = true ; $ schema = $ connection -> getSchemaCollection ( ) ; $ existing = $ schema -> listTables ( ) ; foreach ( $ fixtures as $ name ) { $ class = App :: className ( $ name , 'Test/Fixture' , 'Fixture' ) ; if ( $ class === false ) { throw new RuntimeException ( "Unknown fixture '$name'." ) ; } /** @var \Cake\TestSuite\Fixture\TestFixture $fixture */ $ fixture = new $ class ( $ this -> getConnection ( ) -> configName ( ) ) ; $ table = $ fixture -> table ; if ( in_array ( $ table , $ existing , true ) ) { continue ; } $ fixture -> create ( $ connection ) ; } }
Ensures the tables for the given fixtures exist in the schema.

If the tables do not exist, they will be created on the current model's connection.

@param array $fixtures The fixture names to check and/or insert.
@return void
@throws \RuntimeException When fixtures are missing/unknown/fail.
Ensures the tables for the given fixtures exist in the schema .