More updates to stop using dev or alpha or beta versions.
[yaffs-website] / web / core / tests / Drupal / Tests / Core / Database / Stub / StubConnection.php
1 <?php
2
3 namespace Drupal\Tests\Core\Database\Stub;
4
5 use Drupal\Core\Database\Connection;
6 use Drupal\Core\Database\StatementEmpty;
7
8 /**
9  * A stub of the abstract Connection class for testing purposes.
10  *
11  * Includes minimal implementations of Connection's abstract methods.
12  */
13 class StubConnection extends Connection {
14
15   /**
16    * Public property so we can test driver loading mechanism.
17    *
18    * @var string
19    * @see driver().
20    */
21   public $driver = 'stub';
22
23   /**
24    * {@inheritdoc}
25    */
26   public function queryRange($query, $from, $count, array $args = [], array $options = []) {
27     return new StatementEmpty();
28   }
29
30   /**
31    * {@inheritdoc}
32    */
33   public function queryTemporary($query, array $args = [], array $options = []) {
34     return '';
35   }
36
37   /**
38    * {@inheritdoc}
39    */
40   public function driver() {
41     return $this->driver;
42   }
43
44   /**
45    * {@inheritdoc}
46    */
47   public function databaseType() {
48     return 'stub';
49   }
50
51   /**
52    * {@inheritdoc}
53    */
54   public function createDatabase($database) {
55     return;
56   }
57
58   /**
59    * {@inheritdoc}
60    */
61   public function mapConditionOperator($operator) {
62     return NULL;
63   }
64
65   /**
66    * {@inheritdoc}
67    */
68   public function nextId($existing_id = 0) {
69     return 0;
70   }
71
72 }