DBTest.php in Drupal 7 to 8/9 Module Upgrader 8
File
tests/src/Unit/Plugin/DMU/Converter/Functions/DBTest.php
View source
<?php
namespace Drupal\Tests\drupalmoduleupgrader\Unit\Plugin\DMU\Converter\Functions;
use Pharborist\Parser;
class DBTest extends FunctionCallModifierTestBase {
public function setUp() {
parent::setUp();
$this->plugin = $this
->getPlugin([], [
'function' => 'db_select',
]);
}
public function testRewriteDBSelectAllowedTable() {
$function_call = Parser::parseExpression('db_select("session")');
$this
->assertSame($function_call, $this->plugin
->rewrite($function_call, $this->target));
}
public function testRewriteDBSelectForbiddenTable() {
$function_call = Parser::parseExpression('db_select("variable")');
$this
->assertNull($this->plugin
->rewrite($function_call, $this->target));
}
}