Yaffs site version 1.1
[yaffs-website] / vendor / gabordemooij / redbean / testing / RedUNIT / Base / Close.php
1 <?php
2
3 namespace RedUNIT\Base;
4
5 use RedUNIT\Base as Base;
6 use RedBeanPHP\Facade as R;
7 use RedBeanPHP\ToolBox as ToolBox;
8 use RedBeanPHP\QueryWriter\SQLiteT as SQLiteT;
9
10 /**
11  * Close
12  *
13  * Tests whether we can close the database connection.
14  *
15  * @file    RedUNIT/Base/Close.php
16  * @desc    Tests database closing functionality.
17  * @author  Gabor de Mooij and the RedBeanPHP Community
18  * @license New BSD/GPLv2
19  *
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.
23  */
24 class Close extends Base
25 {
26         /**
27          * Test closing database connection.
28          *
29          * @return void
30          */
31         public function testClose()
32         {
33                 asrt( R::getDatabaseAdapter()->getDatabase()->isConnected(), TRUE );
34                 R::close();
35                 asrt( R::getDatabaseAdapter()->getDatabase()->isConnected(), FALSE );
36         }
37 }
38