EntityDeprecationTest.php

Same filename in other branches
  1. 10 core/tests/Drupal/KernelTests/Core/Entity/EntityDeprecationTest.php

Namespace

Drupal\KernelTests\Core\Entity

File

core/tests/Drupal/KernelTests/Core/Entity/EntityDeprecationTest.php

View source
<?php

namespace Drupal\KernelTests\Core\Entity;


/**
 * Tests the deprecations for the \Drupal\KernelTests\Core\Entity namespace.
 *
 * @group Entity
 * @group legacy
 */
class EntityDeprecationTest extends EntityKernelTestBase {
    
    /**
     * Tests deprecation of \Drupal\KernelTests\Core\Entity\EntityKernelTestBase::createUser().
     */
    public function testCreateUserDeprecation() : void {
        $this->expectDeprecation('Calling createUser() with $values as the first parameter is deprecated in drupal:10.1.0 and will be removed from drupal:11.0.0. Use createUser(array $permissions = [], $name = NULL, $admin = FALSE, array $values = []) instead. See https://www.drupal.org/node/3330762');
        $this->createUser([
            'uid' => 2,
        ]);
        $this->expectDeprecation('Calling createUser() with $permissions as the second parameter is deprecated in drupal:10.1.0 and will be removed from drupal:11.0.0. Use createUser(array $permissions = [], $name = NULL, $admin = FALSE, array $values = []) instead. See https://www.drupal.org/node/3330762');
        $this->createUser([], [
            'administer entity_test content',
        ]);
    }

}

Classes

Title Deprecated Summary
EntityDeprecationTest Tests the deprecations for the \Drupal\KernelTests\Core\Entity namespace.

Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.