/**
  * @param string $sql
  * @param array $params
  * @return static
  */
 public static function findBySql($sql, $params = null)
 {
     $row = DbClient::findRow($sql, $params);
     if ($row === null) {
         return;
     }
     return static::fromArray($row);
 }
 public function testFindRow()
 {
     $this->mockEngineMethod('findRow')->with($this->equalTo('sql'), $this->equalTo(['param']))->will($this->returnValue(true));
     $this->assertTrue(DbClient::findRow('sql', ['param']));
 }