/** @test */ function it_destroys_a_node_type() { $builderService = $this->prophesize('Nuclear\\Hierarchy\\Contract\\Builders\\BuilderServiceContract'); // This part is for the sake of setting the test up $builderService->buildTable('project', Argument::type('int'))->shouldBeCalled(); $repository = new NodeTypeRepository($builderService->reveal()); $nodeType = $repository->create(['name' => 'project', 'label' => 'Project']); $this->assertEquals(1, NodeType::count()); $builderService->destroyTable('project', [], $nodeType->getKey())->shouldBeCalled(); $repository->destroy($nodeType->getKey()); $this->assertEquals(0, NodeType::count()); }