コード例 #1
0
 /**
  * @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)));
 }
コード例 #2
0
ファイル: Cups.php プロジェクト: etd-framework/ipp
 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;
 }
コード例 #3
0
    }
    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;
コード例 #4
0
 public function testExtending()
 {
     $extended = Extended::success();
     $this->assertInstanceOf('Extended', $extended);
 }
コード例 #5
0
ファイル: traits.php プロジェクト: rasmusrosengren/CAS
    {
        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();