예제 #1
0
 public function create($string, $locale = null)
 {
     if (!$locale) {
         $locale = $this->getCurrentLocale();
     }
     $object = new String($this, $locale);
     $object->setValue($string);
     return $object;
 }
예제 #2
0
 public function testMagicCall()
 {
     $args = ['foo', 'bar'];
     $forge = m::mock('StringForge\\StringForge');
     $forge->shouldReceive('execute')->with('bar', self::EXAMPLE_LOCALE, self::EXAMPLE_STRING, $args)->once();
     $string = new String($forge, self::EXAMPLE_LOCALE);
     $string->setValue(self::EXAMPLE_STRING);
     $this->assertSame($string, $string->bar($args[0], $args[1]));
 }