Example #1
0
 /**
  * Test '%s' and '%d' formats to verify that '%s' returns a string and '%d' returns a numeric
  * string when AbstractWidget::getFieldId() is invoked.
  *
  * @param string $format Field id format (e.g. '%s' or '%d')
  * @param string $fieldId Field id
  * @param string $expectedValue The value we expect from AbstractWidget::getFieldId()
  * @param string $method The method to invoke on the result from getFieldId() should return true
  *
  * @dataProvider getFieldIdDataProvider
  */
 public function testGetFieldId($format, $fieldId, $expectedValue, $method)
 {
     $this->_block->setData(self::KEY_FIELD_ID_FORMAT, $format);
     $this->assertTrue(call_user_func($method, $blockFieldId = $this->_block->getFieldId($fieldId)));
     $this->assertSame($expectedValue, $blockFieldId);
 }