Chris@18: 'page', Chris@18: 'name' => 'page', Chris@18: ]); Chris@18: $type->save(); Chris@18: Chris@18: $this->installSchema('node', 'node_access'); Chris@18: } Chris@18: Chris@18: /** Chris@18: * @expectedDeprecation node_load_multiple() is deprecated in Drupal 8.0.0 and will be removed before Drupal 9.0.0. Use \Drupal\node\Entity\Node::loadMultiple(). See https://www.drupal.org/node/2266845 Chris@18: * @expectedDeprecation node_load() is deprecated in Drupal 8.0.0 and will be removed before Drupal 9.0.0. Use \Drupal\node\Entity\Node::load(). See https://www.drupal.org/node/2266845 Chris@18: * @expectedDeprecation node_type_load() is deprecated in Drupal 8.0.0 and will be removed before Drupal 9.0.0. Use \Drupal\node\Entity\NodeType::load(). See https://www.drupal.org/node/2266845 Chris@18: */ Chris@18: public function testEntityLegacyCode() { Chris@18: $this->assertCount(0, node_load_multiple()); Chris@18: Node::create([ Chris@18: 'type' => 'page', Chris@18: 'title' => $this->randomMachineName(), Chris@18: ])->save(); Chris@18: $this->assertCount(1, node_load_multiple()); Chris@18: Node::create([ Chris@18: 'type' => 'page', Chris@18: 'title' => $this->randomMachineName(), Chris@18: ])->save(); Chris@18: $this->assertCount(2, node_load_multiple()); Chris@18: Chris@18: $this->assertNull(node_load(30)); Chris@18: $this->assertInstanceOf(NodeInterface::class, node_load(1)); Chris@18: $this->assertNull(node_type_load('a_node_type_does_not_exist')); Chris@18: $this->assertInstanceOf(NodeTypeInterface::class, node_type_load('page')); Chris@18: } Chris@18: Chris@18: }