ILIAS  release_5-2 Revision v5.2.25-18-g3f80b828510
DefaultValueBinderTest Class Reference
+ Inheritance diagram for DefaultValueBinderTest:
+ Collaboration diagram for DefaultValueBinderTest:

Public Member Functions

 setUp ()
 
 testBindValue ($value)
 @dataProvider binderProvider More...
 
 binderProvider ()
 
 testDataTypeForValue ()
 @dataProvider providerDataTypeForValue More...
 
 providerDataTypeForValue ()
 
 testDataTypeForRichTextObject ()
 

Protected Member Functions

 createCellStub ()
 

Protected Attributes

 $cellStub
 

Detailed Description

Definition at line 5 of file DefaultValueBinderTest.php.

Member Function Documentation

◆ binderProvider()

DefaultValueBinderTest::binderProvider ( )

Definition at line 42 of file DefaultValueBinderTest.php.

43 {
44 return array(
45 array(null),
46 array(''),
47 array('ABC'),
48 array('=SUM(A1:B2)'),
49 array(true),
50 array(false),
51 array(123),
52 array(-123.456),
53 array('123'),
54 array('-123.456'),
55 array('#REF!'),
56 array(new DateTime()),
57 );
58 }

◆ createCellStub()

DefaultValueBinderTest::createCellStub ( )
protected

Definition at line 18 of file DefaultValueBinderTest.php.

19 {
20 // Create a stub for the Cell class.
21 $this->cellStub = $this->getMockBuilder('PHPExcel_Cell')
22 ->disableOriginalConstructor()
23 ->getMock();
24 // Configure the stub.
25 $this->cellStub->expects($this->any())
26 ->method('setValueExplicit')
27 ->will($this->returnValue(true));
28
29 }

Referenced by testBindValue().

+ Here is the caller graph for this function:

◆ providerDataTypeForValue()

DefaultValueBinderTest::providerDataTypeForValue ( )

Definition at line 71 of file DefaultValueBinderTest.php.

72 {
73 return new testDataFileIterator('rawTestData/Cell/DefaultValueBinder.data');
74 }

◆ setUp()

DefaultValueBinderTest::setUp ( )

Definition at line 9 of file DefaultValueBinderTest.php.

10 {
11 if (!defined('PHPEXCEL_ROOT'))
12 {
13 define('PHPEXCEL_ROOT', APPLICATION_PATH . '/');
14 }
15 require_once(PHPEXCEL_ROOT . 'PHPExcel/Autoloader.php');
16 }
defined( 'APPLICATION_ENV')||define( 'APPLICATION_ENV'
Definition: bootstrap.php:27

References defined.

◆ testBindValue()

DefaultValueBinderTest::testBindValue (   $value)

@dataProvider binderProvider

Definition at line 34 of file DefaultValueBinderTest.php.

35 {
36 $this->createCellStub();
38 $result = $binder->bindValue($this->cellStub, $value);
39 $this->assertTrue($result);
40 }
$result

References $result, and createCellStub().

+ Here is the call graph for this function:

◆ testDataTypeForRichTextObject()

DefaultValueBinderTest::testDataTypeForRichTextObject ( )

Definition at line 76 of file DefaultValueBinderTest.php.

77 {
79 $objRichText->createText('Hello World');
80
82 $result = call_user_func(array('PHPExcel_Cell_DefaultValueBinder','dataTypeForValue'), $objRichText);
83 $this->assertEquals($expectedResult, $result);
84 }
$objRichText

References $objRichText, $result, and PHPExcel_Cell_DataType\TYPE_INLINE.

◆ testDataTypeForValue()

DefaultValueBinderTest::testDataTypeForValue ( )

@dataProvider providerDataTypeForValue

Definition at line 63 of file DefaultValueBinderTest.php.

64 {
65 $args = func_get_args();
66 $expectedResult = array_pop($args);
67 $result = call_user_func_array(array('PHPExcel_Cell_DefaultValueBinder','dataTypeForValue'), $args);
68 $this->assertEquals($expectedResult, $result);
69 }

References $result.

Field Documentation

◆ $cellStub

DefaultValueBinderTest::$cellStub
protected

Definition at line 7 of file DefaultValueBinderTest.php.


The documentation for this class was generated from the following file: