assertCRUD example

$this->installEntitySchema($entity_type_id);
      }
    }
  }

  /** * Tests UUID generation in entity CRUD operations. */
  public function testCRUD() {
    // All entity variations have to have the same results.     foreach (entity_test_entity_types() as $entity_type) {
      $this->assertCRUD($entity_type);
    }
  }

  /** * Executes the UUID CRUD tests for the given entity type. * * @param string $entity_type * The entity type to run the tests with. * * @internal */
  
/** * Tests basic load/save/delete operations. * * @covers ::load * @covers ::save * @covers ::exists * @covers ::delete */
  public function testCRUD() {
    $php = new FileStorage($this->standardSettings);
    $this->assertCRUD($php);
  }

  /** * @covers ::writeable * @group legacy */
  public function testWritable() {
    $this->expectDeprecation('Drupal\Component\PhpStorage\FileStorage::writeable() is deprecated in drupal:10.1.0 and will be removed from drupal:11.0.0. There is no replacement. See https://www.drupal.org/node/3155413');
    $php = new FileStorage($this->standardSettings);
    $this->assertTrue($php->writeable());
  }

  
'directory' => $this->directory,
      'bin' => 'test',
      'secret' => $this->secret,
    ];
  }

  /** * Tests basic load/save/delete operations. */
  public function testCRUD() {
    $php = new $this->storageClass($this->settings);
    $this->assertCRUD($php);
  }

  /** * Tests the security of the MTimeProtectedFileStorage implementation. * * We test two attacks: first changes the file mtime, then the directory * mtime too. * * We need to delay over 1 second for mtime test. * @medium */
  
$this->installEntitySchema($entity_type_id);
      }
    }
  }

  /** * Tests basic CRUD functionality of the Entity API. */
  public function testCRUD() {
    // All entity variations have to have the same results.     foreach (entity_test_entity_types() as $entity_type) {
      $this->assertCRUD($entity_type$this->createUser());
    }
  }

  /** * Executes a test set for a defined entity type and user. * * @param string $entity_type * The entity type to run the tests with. * @param \Drupal\user\UserInterface $user1 * The user to run the tests with. * * @internal */
Home | Imprint | This part of the site doesn't use cookies.