/** * @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()); }
/** * 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; }