Пример #1
0
 protected function createDriver($parameters)
 {
     $driver = parent::createDriver($parameters);
     $driverName = strtolower($parameters['driver']);
     if (StringUtils::startsWith($driverName, 'pdo_')) {
         $driverName = substr($driverName, 4);
     }
     $this->driverName = $driverName;
     return $driver;
 }
Пример #2
0
 public function testStartsWith()
 {
     $string = 'john_mcclane';
     $this->assertTrue(StringUtils::startsWith($string, 'john'));
     $this->assertFalse(StringUtils::startsWith($string, 'mcclane'));
 }