Initial Drupal 11 with DDEV setup
This commit is contained in:
17
web/core/tests/fixtures/database_drivers/core/CoreFake/Connection.php
vendored
Normal file
17
web/core/tests/fixtures/database_drivers/core/CoreFake/Connection.php
vendored
Normal file
@ -0,0 +1,17 @@
|
||||
<?php
|
||||
|
||||
namespace Drupal\Core\Database\Driver\CoreFake;
|
||||
|
||||
use Drupal\Driver\Database\fake\Connection as BaseConnection;
|
||||
|
||||
/**
|
||||
* A connection for testing database drivers.
|
||||
*/
|
||||
class Connection extends BaseConnection {
|
||||
|
||||
/**
|
||||
* {@inheritdoc}
|
||||
*/
|
||||
public $driver = 'CoreFake';
|
||||
|
||||
}
|
||||
19
web/core/tests/fixtures/database_drivers/core/CoreFake/Install/Tasks.php
vendored
Normal file
19
web/core/tests/fixtures/database_drivers/core/CoreFake/Install/Tasks.php
vendored
Normal file
@ -0,0 +1,19 @@
|
||||
<?php
|
||||
|
||||
namespace Drupal\Core\Database\Driver\CoreFake\Install;
|
||||
|
||||
use Drupal\Core\Database\Install\Tasks as InstallTasks;
|
||||
|
||||
/**
|
||||
* The database installer structure for the fake database driver.
|
||||
*/
|
||||
class Tasks extends InstallTasks {
|
||||
|
||||
/**
|
||||
* {@inheritdoc}
|
||||
*/
|
||||
public function name() {
|
||||
return 'CoreFake';
|
||||
}
|
||||
|
||||
}
|
||||
10
web/core/tests/fixtures/database_drivers/custom/CoreFake/Connection.php
vendored
Normal file
10
web/core/tests/fixtures/database_drivers/custom/CoreFake/Connection.php
vendored
Normal file
@ -0,0 +1,10 @@
|
||||
<?php
|
||||
|
||||
namespace Drupal\Driver\Database\CoreFake;
|
||||
|
||||
use Drupal\Core\Database\Driver\CoreFake\Connection as CoreFakeConnection;
|
||||
|
||||
/**
|
||||
* A test implementation of \Drupal\Core\Database\Connection.
|
||||
*/
|
||||
class Connection extends CoreFakeConnection {}
|
||||
12
web/core/tests/fixtures/database_drivers/custom/CoreFake/Install/Tasks.php
vendored
Normal file
12
web/core/tests/fixtures/database_drivers/custom/CoreFake/Install/Tasks.php
vendored
Normal file
@ -0,0 +1,12 @@
|
||||
<?php
|
||||
|
||||
namespace Drupal\Driver\Database\CoreFake\Install;
|
||||
|
||||
use Drupal\Core\Database\Driver\CoreFake\Install\Tasks as BaseInstallTasks;
|
||||
|
||||
/**
|
||||
* The database installer structure for a custom database driver.
|
||||
*/
|
||||
class Tasks extends BaseInstallTasks {
|
||||
|
||||
}
|
||||
159
web/core/tests/fixtures/database_drivers/custom/fake/Connection.php
vendored
Normal file
159
web/core/tests/fixtures/database_drivers/custom/fake/Connection.php
vendored
Normal file
@ -0,0 +1,159 @@
|
||||
<?php
|
||||
|
||||
namespace Drupal\Driver\Database\fake;
|
||||
|
||||
use Drupal\Core\Database\Connection as CoreConnection;
|
||||
use Drupal\Core\Database\ExceptionHandler;
|
||||
use Drupal\Core\Database\Query\Condition;
|
||||
use Drupal\Core\Database\Query\Delete;
|
||||
use Drupal\Core\Database\Query\Insert;
|
||||
use Drupal\Core\Database\Query\Merge;
|
||||
use Drupal\Core\Database\Query\Select;
|
||||
use Drupal\Core\Database\Query\Truncate;
|
||||
use Drupal\Core\Database\Query\Update;
|
||||
use Drupal\Core\Database\Query\Upsert;
|
||||
use Drupal\Core\Database\StatementWrapper;
|
||||
use Drupal\Core\Database\Transaction;
|
||||
|
||||
/**
|
||||
* A fake Connection class for testing purposes.
|
||||
*/
|
||||
class Connection extends CoreConnection {
|
||||
|
||||
/**
|
||||
* {@inheritdoc}
|
||||
*/
|
||||
protected $statementClass = NULL;
|
||||
|
||||
/**
|
||||
* {@inheritdoc}
|
||||
*/
|
||||
protected $statementWrapperClass = StatementWrapper::class;
|
||||
|
||||
/**
|
||||
* {@inheritdoc}
|
||||
*/
|
||||
protected $identifierQuotes = ['"', '"'];
|
||||
|
||||
/**
|
||||
* Public property so we can test driver loading mechanism.
|
||||
*
|
||||
* @var string
|
||||
* @see driver().
|
||||
*/
|
||||
public $driver = 'fake';
|
||||
|
||||
/**
|
||||
* {@inheritdoc}
|
||||
*/
|
||||
public function queryRange($query, $from, $count, array $args = [], array $options = []) {
|
||||
return NULL;
|
||||
}
|
||||
|
||||
/**
|
||||
* {@inheritdoc}
|
||||
*/
|
||||
public function driver() {
|
||||
return $this->driver;
|
||||
}
|
||||
|
||||
/**
|
||||
* {@inheritdoc}
|
||||
*/
|
||||
public function databaseType() {
|
||||
return 'fake';
|
||||
}
|
||||
|
||||
/**
|
||||
* {@inheritdoc}
|
||||
*/
|
||||
public function createDatabase($database) {}
|
||||
|
||||
/**
|
||||
* {@inheritdoc}
|
||||
*/
|
||||
public function mapConditionOperator($operator) {
|
||||
return NULL;
|
||||
}
|
||||
|
||||
/**
|
||||
* {@inheritdoc}
|
||||
*/
|
||||
public function exceptionHandler() {
|
||||
return new ExceptionHandler();
|
||||
}
|
||||
|
||||
/**
|
||||
* {@inheritdoc}
|
||||
*/
|
||||
public function select($table, $alias = NULL, array $options = []) {
|
||||
return new Select($this, $table, $alias, $options);
|
||||
}
|
||||
|
||||
/**
|
||||
* {@inheritdoc}
|
||||
*/
|
||||
public function insert($table, array $options = []) {
|
||||
return new Insert($this, $table, $options);
|
||||
}
|
||||
|
||||
/**
|
||||
* {@inheritdoc}
|
||||
*/
|
||||
public function merge($table, array $options = []) {
|
||||
return new Merge($this, $table, $options);
|
||||
}
|
||||
|
||||
/**
|
||||
* {@inheritdoc}
|
||||
*/
|
||||
public function upsert($table, array $options = []) {
|
||||
return new Upsert($this, $table, $options);
|
||||
}
|
||||
|
||||
/**
|
||||
* {@inheritdoc}
|
||||
*/
|
||||
public function update($table, array $options = []) {
|
||||
return new Update($this, $table, $options);
|
||||
}
|
||||
|
||||
/**
|
||||
* {@inheritdoc}
|
||||
*/
|
||||
public function delete($table, array $options = []) {
|
||||
return new Delete($this, $table, $options);
|
||||
}
|
||||
|
||||
/**
|
||||
* {@inheritdoc}
|
||||
*/
|
||||
public function truncate($table, array $options = []) {
|
||||
return new Truncate($this, $table, $options);
|
||||
}
|
||||
|
||||
/**
|
||||
* {@inheritdoc}
|
||||
*/
|
||||
public function schema() {
|
||||
if (empty($this->schema)) {
|
||||
$this->schema = new Schema($this);
|
||||
}
|
||||
return $this->schema;
|
||||
}
|
||||
|
||||
/**
|
||||
* {@inheritdoc}
|
||||
*/
|
||||
public function condition($conjunction) {
|
||||
return new Condition($conjunction, FALSE);
|
||||
}
|
||||
|
||||
/**
|
||||
* {@inheritdoc}
|
||||
*/
|
||||
public function startTransaction($name = '') {
|
||||
return new Transaction($this, $name);
|
||||
}
|
||||
|
||||
}
|
||||
19
web/core/tests/fixtures/database_drivers/custom/fake/Install/Tasks.php
vendored
Normal file
19
web/core/tests/fixtures/database_drivers/custom/fake/Install/Tasks.php
vendored
Normal file
@ -0,0 +1,19 @@
|
||||
<?php
|
||||
|
||||
namespace Drupal\Driver\Database\fake\Install;
|
||||
|
||||
use Drupal\Core\Database\Install\Tasks as InstallTasks;
|
||||
|
||||
/**
|
||||
* A task for testing database drivers.
|
||||
*/
|
||||
class Tasks extends InstallTasks {
|
||||
|
||||
/**
|
||||
* {@inheritdoc}
|
||||
*/
|
||||
public function name() {
|
||||
return 'fake';
|
||||
}
|
||||
|
||||
}
|
||||
@ -0,0 +1,17 @@
|
||||
<?php
|
||||
|
||||
namespace Drupal\core_fake\Driver\Database\CoreFake;
|
||||
|
||||
use Drupal\Driver\Database\fake\Connection as BaseConnection;
|
||||
|
||||
/**
|
||||
* CoreFake implementation of \Drupal\Core\Database\Connection.
|
||||
*/
|
||||
class Connection extends BaseConnection {
|
||||
|
||||
/**
|
||||
* {@inheritdoc}
|
||||
*/
|
||||
public $driver = 'CoreFake';
|
||||
|
||||
}
|
||||
@ -0,0 +1,19 @@
|
||||
<?php
|
||||
|
||||
namespace Drupal\core_fake\Driver\Database\CoreFake\Install;
|
||||
|
||||
use Drupal\Core\Database\Install\Tasks as InstallTasks;
|
||||
|
||||
/**
|
||||
* Specifies installation tasks for CoreFake.
|
||||
*/
|
||||
class Tasks extends InstallTasks {
|
||||
|
||||
/**
|
||||
* {@inheritdoc}
|
||||
*/
|
||||
public function name() {
|
||||
return 'CoreFake';
|
||||
}
|
||||
|
||||
}
|
||||
@ -0,0 +1,12 @@
|
||||
<?php
|
||||
|
||||
namespace Drupal\core_fake\Driver\Database\CoreFakeWithAllCustomClasses;
|
||||
|
||||
use Drupal\Core\Database\Query\Condition as QueryCondition;
|
||||
|
||||
/**
|
||||
* CoreFakeWithAllCustomClasses implementation of \Drupal\Core\Database\Condition.
|
||||
*/
|
||||
class Condition extends QueryCondition {
|
||||
|
||||
}
|
||||
@ -0,0 +1,97 @@
|
||||
<?php
|
||||
|
||||
namespace Drupal\core_fake\Driver\Database\CoreFakeWithAllCustomClasses;
|
||||
|
||||
use Drupal\Driver\Database\fake\Connection as BaseConnection;
|
||||
|
||||
/**
|
||||
* CoreFakeWithAllCustomClasses implementation of \Drupal\Core\Database\Connection.
|
||||
*/
|
||||
class Connection extends BaseConnection {
|
||||
|
||||
/**
|
||||
* {@inheritdoc}
|
||||
*/
|
||||
public $driver = 'CoreFakeWithAllCustomClasses';
|
||||
|
||||
/**
|
||||
* {@inheritdoc}
|
||||
*/
|
||||
public function exceptionHandler() {
|
||||
return new ExceptionHandler();
|
||||
}
|
||||
|
||||
/**
|
||||
* {@inheritdoc}
|
||||
*/
|
||||
public function select($table, $alias = NULL, array $options = []) {
|
||||
return new Select($this, $table, $alias, $options);
|
||||
}
|
||||
|
||||
/**
|
||||
* {@inheritdoc}
|
||||
*/
|
||||
public function insert($table, array $options = []) {
|
||||
return new Insert($this, $table, $options);
|
||||
}
|
||||
|
||||
/**
|
||||
* {@inheritdoc}
|
||||
*/
|
||||
public function merge($table, array $options = []) {
|
||||
return new Merge($this, $table, $options);
|
||||
}
|
||||
|
||||
/**
|
||||
* {@inheritdoc}
|
||||
*/
|
||||
public function upsert($table, array $options = []) {
|
||||
return new Upsert($this, $table, $options);
|
||||
}
|
||||
|
||||
/**
|
||||
* {@inheritdoc}
|
||||
*/
|
||||
public function update($table, array $options = []) {
|
||||
return new Update($this, $table, $options);
|
||||
}
|
||||
|
||||
/**
|
||||
* {@inheritdoc}
|
||||
*/
|
||||
public function delete($table, array $options = []) {
|
||||
return new Delete($this, $table, $options);
|
||||
}
|
||||
|
||||
/**
|
||||
* {@inheritdoc}
|
||||
*/
|
||||
public function truncate($table, array $options = []) {
|
||||
return new Truncate($this, $table, $options);
|
||||
}
|
||||
|
||||
/**
|
||||
* {@inheritdoc}
|
||||
*/
|
||||
public function schema() {
|
||||
if (empty($this->schema)) {
|
||||
$this->schema = new Schema($this);
|
||||
}
|
||||
return $this->schema;
|
||||
}
|
||||
|
||||
/**
|
||||
* {@inheritdoc}
|
||||
*/
|
||||
public function condition($conjunction) {
|
||||
return new Condition($conjunction, FALSE);
|
||||
}
|
||||
|
||||
/**
|
||||
* {@inheritdoc}
|
||||
*/
|
||||
public function startTransaction($name = '') {
|
||||
return new Transaction($this, $name);
|
||||
}
|
||||
|
||||
}
|
||||
@ -0,0 +1,12 @@
|
||||
<?php
|
||||
|
||||
namespace Drupal\core_fake\Driver\Database\CoreFakeWithAllCustomClasses;
|
||||
|
||||
use Drupal\Core\Database\Query\Delete as QueryDelete;
|
||||
|
||||
/**
|
||||
* CoreFakeWithAllCustomClasses implementation of \Drupal\Core\Database\Delete.
|
||||
*/
|
||||
class Delete extends QueryDelete {
|
||||
|
||||
}
|
||||
@ -0,0 +1,12 @@
|
||||
<?php
|
||||
|
||||
namespace Drupal\core_fake\Driver\Database\CoreFakeWithAllCustomClasses;
|
||||
|
||||
use Drupal\Core\Database\ExceptionHandler as BaseExceptionHandler;
|
||||
|
||||
/**
|
||||
* CoreFakeWithAllCustomClasses implementation of \Drupal\Core\Database\ExceptionHandler.
|
||||
*/
|
||||
class ExceptionHandler extends BaseExceptionHandler {
|
||||
|
||||
}
|
||||
@ -0,0 +1,12 @@
|
||||
<?php
|
||||
|
||||
namespace Drupal\core_fake\Driver\Database\CoreFakeWithAllCustomClasses;
|
||||
|
||||
use Drupal\Core\Database\Query\Insert as QueryInsert;
|
||||
|
||||
/**
|
||||
* CoreFakeWithAllCustomClasses implementation of \Drupal\Core\Database\Insert.
|
||||
*/
|
||||
class Insert extends QueryInsert {
|
||||
|
||||
}
|
||||
@ -0,0 +1,19 @@
|
||||
<?php
|
||||
|
||||
namespace Drupal\core_fake\Driver\Database\CoreFakeWithAllCustomClasses\Install;
|
||||
|
||||
use Drupal\Core\Database\Install\Tasks as InstallTasks;
|
||||
|
||||
/**
|
||||
* Specifies installation tasks for CoreFakeWithAllCustomClasses.
|
||||
*/
|
||||
class Tasks extends InstallTasks {
|
||||
|
||||
/**
|
||||
* {@inheritdoc}
|
||||
*/
|
||||
public function name() {
|
||||
return 'CoreFakeWithAllCustomClasses';
|
||||
}
|
||||
|
||||
}
|
||||
@ -0,0 +1,12 @@
|
||||
<?php
|
||||
|
||||
namespace Drupal\core_fake\Driver\Database\CoreFakeWithAllCustomClasses;
|
||||
|
||||
use Drupal\Core\Database\Query\Merge as QueryMerge;
|
||||
|
||||
/**
|
||||
* CoreFakeWithAllCustomClasses implementation of \Drupal\Core\Database\Merge.
|
||||
*/
|
||||
class Merge extends QueryMerge {
|
||||
|
||||
}
|
||||
@ -0,0 +1,12 @@
|
||||
<?php
|
||||
|
||||
namespace Drupal\core_fake\Driver\Database\CoreFakeWithAllCustomClasses;
|
||||
|
||||
use Drupal\Core\Database\Query\PagerSelectExtender as QueryPagerSelectExtender;
|
||||
|
||||
/**
|
||||
* CoreFakeWithAllCustomClasses implementation of \Drupal\Core\Database\Query\PagerSelectExtender.
|
||||
*/
|
||||
class PagerSelectExtender extends QueryPagerSelectExtender {
|
||||
|
||||
}
|
||||
@ -0,0 +1,12 @@
|
||||
<?php
|
||||
|
||||
namespace Drupal\core_fake\Driver\Database\CoreFakeWithAllCustomClasses;
|
||||
|
||||
use Drupal\Tests\Core\Database\Stub\StubSchema;
|
||||
|
||||
/**
|
||||
* CoreFakeWithAllCustomClasses implementation of \Drupal\Core\Database\Schema.
|
||||
*/
|
||||
class Schema extends StubSchema {
|
||||
|
||||
}
|
||||
@ -0,0 +1,12 @@
|
||||
<?php
|
||||
|
||||
namespace Drupal\core_fake\Driver\Database\CoreFakeWithAllCustomClasses;
|
||||
|
||||
use Drupal\search\SearchQuery as CoreSearchQuery;
|
||||
|
||||
/**
|
||||
* CoreFakeWithAllCustomClasses implementation of \Drupal\search\SearchQuery.
|
||||
*/
|
||||
class SearchQuery extends CoreSearchQuery {
|
||||
|
||||
}
|
||||
@ -0,0 +1,12 @@
|
||||
<?php
|
||||
|
||||
namespace Drupal\core_fake\Driver\Database\CoreFakeWithAllCustomClasses;
|
||||
|
||||
use Drupal\Core\Database\Query\Select as QuerySelect;
|
||||
|
||||
/**
|
||||
* CoreFakeWithAllCustomClasses implementation of \Drupal\Core\Database\Select.
|
||||
*/
|
||||
class Select extends QuerySelect {
|
||||
|
||||
}
|
||||
@ -0,0 +1,12 @@
|
||||
<?php
|
||||
|
||||
namespace Drupal\core_fake\Driver\Database\CoreFakeWithAllCustomClasses;
|
||||
|
||||
use Drupal\Core\Database\Query\TableSortExtender as QueryTableSortExtender;
|
||||
|
||||
/**
|
||||
* CoreFakeWithAllCustomClasses implementation of \Drupal\Core\Database\Query\TableSortExtender.
|
||||
*/
|
||||
class TableSortExtender extends QueryTableSortExtender {
|
||||
|
||||
}
|
||||
@ -0,0 +1,12 @@
|
||||
<?php
|
||||
|
||||
namespace Drupal\core_fake\Driver\Database\CoreFakeWithAllCustomClasses;
|
||||
|
||||
use Drupal\Core\Database\Transaction as DatabaseTransaction;
|
||||
|
||||
/**
|
||||
* CoreFakeWithAllCustomClasses implementation of \Drupal\Core\Database\Transaction.
|
||||
*/
|
||||
class Transaction extends DatabaseTransaction {
|
||||
|
||||
}
|
||||
@ -0,0 +1,12 @@
|
||||
<?php
|
||||
|
||||
namespace Drupal\core_fake\Driver\Database\CoreFakeWithAllCustomClasses;
|
||||
|
||||
use Drupal\Core\Database\Query\Truncate as QueryTruncate;
|
||||
|
||||
/**
|
||||
* CoreFakeWithAllCustomClasses implementation of \Drupal\Core\Database\Truncate.
|
||||
*/
|
||||
class Truncate extends QueryTruncate {
|
||||
|
||||
}
|
||||
@ -0,0 +1,12 @@
|
||||
<?php
|
||||
|
||||
namespace Drupal\core_fake\Driver\Database\CoreFakeWithAllCustomClasses;
|
||||
|
||||
use Drupal\Core\Database\Query\Update as QueryUpdate;
|
||||
|
||||
/**
|
||||
* CoreFakeWithAllCustomClasses implementation of \Drupal\Core\Database\Update.
|
||||
*/
|
||||
class Update extends QueryUpdate {
|
||||
|
||||
}
|
||||
@ -0,0 +1,24 @@
|
||||
<?php
|
||||
|
||||
namespace Drupal\core_fake\Driver\Database\CoreFakeWithAllCustomClasses;
|
||||
|
||||
use Drupal\Core\Database\Query\Upsert as QueryUpsert;
|
||||
|
||||
/**
|
||||
* CoreFakeWithAllCustomClasses implementation of \Drupal\Core\Database\Upsert.
|
||||
*/
|
||||
class Upsert extends QueryUpsert {
|
||||
|
||||
/**
|
||||
* {@inheritdoc}
|
||||
*/
|
||||
public function execute() {}
|
||||
|
||||
/**
|
||||
* {@inheritdoc}
|
||||
*/
|
||||
public function __toString() {
|
||||
throw new \BadMethodCallException('Upsert not implemented');
|
||||
}
|
||||
|
||||
}
|
||||
@ -0,0 +1,12 @@
|
||||
<?php
|
||||
|
||||
namespace Drupal\core_fake\Driver\Database\CoreFakeWithAllCustomClasses;
|
||||
|
||||
use Drupal\search\ViewsSearchQuery as CoreViewsSearchQuery;
|
||||
|
||||
/**
|
||||
* CoreFakeWithAllCustomClasses implementation of \Drupal\search\ViewsSearchQuery.
|
||||
*/
|
||||
class ViewsSearchQuery extends CoreViewsSearchQuery {
|
||||
|
||||
}
|
||||
Reference in New Issue
Block a user