3 namespace RedUNIT\Base;
5 use RedUNIT\Base as Base;
6 use RedBeanPHP\Facade as R;
11 * Tests the nuke() command. The nuke command empties an entire database
12 * and should also be capable of removing all foreign keys, constraints and
15 * @file RedUNIT/Base/Nuke.php
16 * @desc Test the nuke() function.
17 * @author Gabor de Mooij and the RedBeanPHP Community
18 * @license New BSD/GPLv2
20 * (c) G.J.G.T. (Gabor) de Mooij and the RedBeanPHP Community.
21 * This source file is subject to the New BSD/GPLv2 License that is bundled
22 * with this source code in the file license.txt.
24 class Nuke extends Base
31 public function testNuke()
33 $bean = R::dispense( 'bean' );
35 asrt( count( R::getWriter()->getTables() ), 1 );
37 asrt( count( R::getWriter()->getTables() ), 0 );
38 $bean = R::dispense( 'bean' );
40 asrt( count( R::getWriter()->getTables() ), 1 );
44 asrt( count( R::getWriter()->getTables() ), 1 );