Skip to content

Commit

Permalink
UHF-10539: Convert function test to dtt test
Browse files Browse the repository at this point in the history
  • Loading branch information
hyrsky committed Dec 9, 2024
1 parent d54979e commit 950b694
Showing 1 changed file with 8 additions and 29 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -2,57 +2,36 @@

declare(strict_types=1);

namespace src\Functional;
namespace src\ExistingSite;

use Drupal\Core\Entity\EntityTypeManagerInterface;
use Drupal\Core\Url;
use Drupal\helfi_platform_config\Entity\PublishableRedirect;
use Drupal\Tests\BrowserTestBase;
use Drupal\Tests\user\Traits\UserCreationTrait;
use Drupal\Tests\helfi_api_base\Functional\ExistingSiteTestBase;

/**
* Tests `redirect.add` form.
*
* @group helfi_platform_config
*/
class RedirectFormTest extends BrowserTestBase {

use UserCreationTrait;

/**
* {@inheritdoc}
*/
protected $defaultTheme = 'stark';
class RedirectFormTest extends ExistingSiteTestBase {

/**
* {@inheritdoc}
*/
protected static $modules = [
'redirect',
'helfi_platform_config',
];

/**
* {@inheritDoc}
* Tests that saving redirect from entity form sets the custom field to TRUE.
*/
protected function setUp() : void {
parent::setUp();

public function testRedirectForm() {
$user = $this->createUser([
'administer redirects',
]);
$this->drupalLogin($user);
}

/**
* Tests that saving redirect from entity form sets the custom field to TRUE.
*/
public function testRedirectForm() {
$edit = [
'redirect_source[0][path]' => 'test',
'redirect_redirect[0][uri]' => '<front>',
'status_code' => 307,
];

$this->drupalGet(Url::fromRoute('redirect.add')->toString());
$this->drupalGet(Url::fromRoute('redirect.add'));
$this->submitForm($edit, 'Save');

$redirects = $this->container
Expand Down

0 comments on commit 950b694

Please sign in to comment.