public function testLocaleIsPassedToField_SetAfterAddingTheField() { $field = $this->getMockForAbstractClass(__NAMESPACE__ . '\\FieldGroupTest_Field', array(), '', false, false); $field->expects($this->any())->method('getKey')->will($this->returnValue('firstName')); // DOESN'T WORK! // $field = $this->getMock(__NAMESPACE__ . '\Fixtures\Field', array(), array(), '', false, false); // $field->expects($this->once()) // ->method('setLocale') // ->with($this->equalTo('de_AT')); // $field->expects($this->once()) // ->method('setLocale') // ->with($this->equalTo('de_DE')); $group = new FieldGroup('author'); $group->add($field); $group->setLocale('de_DE'); $this->assertEquals(array(class_exists('\\Locale', false) ? \Locale::getDefault() : 'en', 'de_DE'), $field->locales); }