예제 #1
0
 public function asListWithPrimitives()
 {
     $list = Arrays::asList(new ArrayList('one', 'two', 'three'));
     $this->assertSubclass($list, 'util.collections.IList');
     $this->assertEquals(3, $list->size());
     $this->assertEquals('one', $list->get(0));
     $this->assertEquals('two', $list->get(1));
     $this->assertEquals('three', $list->get(2));
 }
예제 #2
0
 private static function formatIllegalArgumentErrorMessage($target, Method $serviceMethod, $args)
 {
     $source = self::getSourceRepresentation($serviceMethod);
     $sb = "Blocked attempt to invoke method '{$source}'";
     if (!is_null($target)) {
         $printedType = self::printTypeName(Classes::classOf($target));
         $sb .= " on target '{$printedType}'";
     }
     $sb .= ' with invalid arguments';
     if (!is_null($args) && !empty($args)) {
         $sb .= Arrays::asList($args);
     }
     return $sb;
 }