예제 #1
0
파일: IntTest.php 프로젝트: kafruhs/fws
    /**
     * @param $value
     * @param $expectedException
     * @throws base_database_Exception
     *
     * @test
     * @dataProvider toStringTestDataProvider
     */
    public function toStringTest($value, $expectedException)
    {
        if ($expectedException === true) {
            $this->setExpectedException('base_database_Exception', TMS(base_database_Exception::NO_INT_VALUE, array('value' => $value)));
        }

        $term = new base_database_term_Int();
        $term->setValue($value);

        $this->assertEquals($value, $term->toString());
    }
예제 #2
0
파일: DB.php 프로젝트: kafruhs/fws
 /**
  * get a string term
  *
  * @param $value
  * @return \base_database_term_String
  * @throws base_database_Exception
  */
 public static function term($value)
 {
     try {
         $term = new base_database_term_String();
         $term->setValue($value);
     } catch (base_database_Exception $e) {
         $term = new base_database_term_Int();
         $term->setValue($value);
     }
     return $term;
 }