try {
$myClass->validate(1, 2, 4, 3);
$this->fail( "Exception with 101 code should be thrown" );
} catch (Exception $e) {
$this->assertEquals( 101, $e->getCode());
}
if(count($errors) > 0) throw new Exception(trim(implode(" ", $errors)), 101);