Esempio n. 1
0
 public function testGetDatabaseSchema()
 {
     $schema = UtilUnitTest::call_private_or_protected_method(get_class($this->__extractor), '_getDatabaseSchema', $this->__extractor, $this->__mySqlConnector);
     $this->assertTrue(is_array($schema));
     /**
      * @var array $schema
      */
     $sortedSchema = [];
     $keys = array_keys($schema);
     sort($keys);
     foreach ($keys as $_key) {
         $fields = $schema[$_key];
         sort($fields);
         $sortedSchema[$_key] = $fields;
     }
     $referencePath = $this->__generalConfiguration['test']['dir.references'] . DIRECTORY_SEPARATOR . 'mysql_db_schema.json';
     $this->assertJsonStringEqualsJsonFile($referencePath, json_encode($sortedSchema));
 }
Esempio n. 2
0
 public function testProtectedNonStatic()
 {
     $o = new ClassToTest();
     $o->factor = 5;
     $this->assertEquals(50, UtilUnitTest::call_private_or_protected_method('\\dbeurive\\UtilTest\\ClassToTest', '_protectedNonStatic', $o, 10));
 }