Zend certified PHP/Magento developer

Is this a good PHPUnit test?

I’m new to unit testing. I’m making a mysqli wrapper and I want to write a unit test for connecting to a database. Here’s what I came up with:

< ?php use PHPUnitFrameworkTestCase; class MyClassTest extends TestCase { protected static $host = 'host'; protected static $username = 'username'; protected static $password = '123'; protected static $database = 'abc'; public function testConnection() { $dbh = new nsMyClass( self::$host, self::$username, self::$password, self::$database); $this->assertSame( get_class($dbh->conn()), mysqli::class); } } 

submitted by /u/john_dumb_bear
[link] [comments]