Chris@18: installEntitySchema('user'); Chris@18: } Chris@18: Chris@18: /** Chris@18: * @expectedDeprecation user_load_multiple() is deprecated in Drupal 8.0.0 and will be removed before Drupal 9.0.0. Use \Drupal\user\Entity\User::loadMultiple(). See https://www.drupal.org/node/2266845 Chris@18: * @expectedDeprecation user_load() is deprecated in Drupal 8.0.0 and will be removed before Drupal 9.0.0. Use \Drupal\user\Entity\User::load(). See https://www.drupal.org/node/2266845 Chris@18: */ Chris@18: public function testEntityLegacyCode() { Chris@18: $this->installSchema('system', ['sequences']); Chris@18: $this->assertCount(0, user_load_multiple()); Chris@18: User::create(['name' => 'foo'])->save(); Chris@18: $this->assertCount(1, user_load_multiple()); Chris@18: User::create(['name' => 'bar'])->save(); Chris@18: $this->assertCount(2, user_load_multiple()); Chris@18: Chris@18: $this->assertNull(user_load(300)); Chris@18: $this->assertInstanceOf(UserInterface::class, user_load(1)); Chris@18: } Chris@18: Chris@18: }