3 namespace Drupal\Tests\drupalmoduleupgrader\Unit\Plugin\DMU\Converter\Functions;
8 * @group DMU.Converter.Functions
9 * @covers \Drupal\drupalmoduleupgrader\Plugin\DMU\Converter\Functions\DB
11 * Currently, the DB plugin behaves identically for every function it handles,
12 * so I'm only bothering to test db_select().
14 class DBTest extends FunctionCallModifierTestBase {
16 public function setUp() {
18 $this->plugin = $this->getPlugin([], [ 'function' => 'db_select' ]);
21 public function testRewriteDBSelectAllowedTable() {
22 $function_call = Parser::parseExpression('db_select("session")');
23 $this->assertSame($function_call, $this->plugin->rewrite($function_call, $this->target));
26 public function testRewriteDBSelectForbiddenTable() {
27 $function_call = Parser::parseExpression('db_select("variable")');
28 $this->assertNull($this->plugin->rewrite($function_call, $this->target));