Namespace
Drupal\Tests\batch_example\Functional
File
-
modules/batch_example/tests/src/Functional/BatchExampleWebTest.php
View source
<?php
namespace Drupal\Tests\batch_example\Functional;
use Drupal\Tests\BrowserTestBase;
class BatchExampleWebTest extends BrowserTestBase {
protected $defaultTheme = 'stark';
protected static $modules = [
'node',
'batch_example',
];
public function testBatchExampleBasic() {
$web_user = $this->drupalCreateUser([
'access content',
]);
$this->drupalLogin($web_user);
$this->drupalGet('examples/batch_example');
$this->submitForm([
'batch' => 'batch_1',
], 'Go');
$this->assertSession()
->pageTextContains('1000 results processed');
$this->drupalGet('examples/batch_example');
$this->submitForm([
'batch' => 'batch_2',
], 'Go');
$this->assertSession()
->pageTextContains('600 results processed');
}
}
Classes