Example #1
0
 /** @test */
 function it_scopes_nodes_with_type()
 {
     $this->assertNull(Node::withType('project')->first());
     $this->assertNull(Node::withType('non-existing')->first());
     $node = $this->getNode();
     $node->fill(['en' => ['title' => 'English Title', 'description' => 'English Description', 'area' => 100000], 'tr' => ['title' => 'Türkçe Başlık', 'description' => 'Türkçe Açıklama', 'area' => 30000]]);
     $node->save();
     $this->assertInstanceOf('Nuclear\\Hierarchy\\Node', Node::withType('project')->first());
     $this->assertNull(Node::withType('non-existing')->first());
 }