11<?php
22
3+ namespace tests ;
4+
35use Illuminate \Database \Capsule \Manager as Capsule ;
6+ use Illuminate \Database \Schema \Blueprint ;
47use Kalnoy \Nestedset \NestedSet ;
8+ use PHPUnit \Framework \TestCase ;
9+ use tests \models \Category ;
510
6- class NodeTest extends PHPUnit \ Framework \ TestCase
11+ class NodeTest extends TestCase
712{
813 public static function setUpBeforeClass (): void
914 {
@@ -13,7 +18,7 @@ public static function setUpBeforeClass(): void
1318
1419 Capsule::disableQueryLog ();
1520
16- $ schema ->create ('categories ' , function (Illuminate \ Database \ Schema \ Blueprint $ table ) {
21+ $ schema ->create ('categories ' , function (Blueprint $ table ) {
1722 $ table ->increments ('id ' );
1823 $ table ->string ('name ' );
1924 $ table ->softDeletes ();
@@ -225,7 +230,7 @@ public function testCategoryMovesUp()
225230
226231 public function testFailsToInsertIntoChild ()
227232 {
228- $ this ->expectException (Exception::class);
233+ $ this ->expectException (\ Exception::class);
229234
230235 $ node = $ this ->findCategory ('notebooks ' );
231236 $ target = $ node ->children ()->first ();
@@ -235,7 +240,7 @@ public function testFailsToInsertIntoChild()
235240
236241 public function testFailsToAppendIntoItself ()
237242 {
238- $ this ->expectException (Exception::class);
243+ $ this ->expectException (\ Exception::class);
239244
240245 $ node = $ this ->findCategory ('notebooks ' );
241246
@@ -244,7 +249,7 @@ public function testFailsToAppendIntoItself()
244249
245250 public function testFailsToPrependIntoItself ()
246251 {
247- $ this ->expectException (Exception::class);
252+ $ this ->expectException (\ Exception::class);
248253
249254 $ node = $ this ->findCategory ('notebooks ' );
250255
@@ -339,7 +344,7 @@ public function testParentIdAttributeAccessorAppendsNode()
339344
340345 public function testFailsToSaveNodeUntilNotInserted ()
341346 {
342- $ this ->expectException (Exception::class);
347+ $ this ->expectException (\ Exception::class);
343348
344349 $ node = new Category ();
345350 $ node ->save ();
@@ -405,7 +410,7 @@ public function testSoftDeletedNodeisDeletedWhenParentIsDeleted()
405410
406411 public function testFailsToSaveNodeUntilParentIsSaved ()
407412 {
408- $ this ->expectException (Exception::class);
413+ $ this ->expectException (\ Exception::class);
409414
410415 $ node = new Category (['title ' => 'Node ' ]);
411416 $ parent = new Category (['title ' => 'Parent ' ]);
0 commit comments