/** * @param array $rowData * @param string $expectedResult * @dataProvider renderDataProvider */ public function testRender(array $rowData, $expectedResult) { $selectedFlatArray = array(1 => 'One'); $this->_column->expects($this->once())->method('getValues')->will($this->returnValue($selectedFlatArray)); $this->_column->expects($this->once())->method('getIndex')->will($this->returnValue('label')); $this->_column->expects($this->once())->method('getHtmlName')->will($this->returnValue('test[]')); $this->_converter->expects($this->never())->method('toFlatArray'); $this->assertEquals($expectedResult, $this->_object->render(new \Magento\Framework\Object($rowData))); }
protected function _interpretEnum($attribute_name, $value) { $value_parsed = self::_interpretInteger($value); switch ($attribute_name) { case 'cpi': case 'lpi': $value = $value_parsed; break; default: $value = parent::_interpretEnum($attribute_name, $value); break; } return $value; }
} function Parent() { echo PARENT::func(); } } class Extended2 extends Extended { function func() { echo " Extended2"; } function parent() { echo PARENT::Func(); } function grandpa() { echo PARENT::parent(); } } $var1 = new Base(); $var2 = new Extended(); $var3 = new Extended2(); $var1->func(); $var2->func(); $var3->func(); $var2->parent(); $var3->parent(); $var3->grandpa(); echo PHP_EOL;
public function testExtending() { $extended = Extended::success(); $this->assertInstanceOf('Extended', $extended); }
{ echo "Hello"; } } trait World { /** * Cannot be user because is conside incompitable */ //protected $difference = true; protected $same = true; public static function sayWorld() { echo "World"; } } class Base { use Hello, World; } class Extended extends Base { public static function sayUniverse() { echo "Hello Universe!"; } } Extended::sayHello(); Extended::sayWorld(); Extended::sayUniverse();