ILIAS  release_5-3 Revision v5.3.23-19-g915713cf615
DefaultValueBinderTest Class Reference
+ Inheritance diagram for DefaultValueBinderTest:
+ Collaboration diagram for DefaultValueBinderTest:

Public Member Functions

 setUp ()
 
 testBindValue ($value)
 binderProvider More...
 
 binderProvider ()
 
 testDataTypeForValue ()
 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.

References array.

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  }
Create styles array
The data for the language used.

◆ createCellStub()

DefaultValueBinderTest::createCellStub ( )
protected

Definition at line 18 of file DefaultValueBinderTest.php.

Referenced by testBindValue().

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  }
+ 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.

References defined.

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

◆ testBindValue()

DefaultValueBinderTest::testBindValue (   $value)

binderProvider

Definition at line 34 of file DefaultValueBinderTest.php.

References $result, and createCellStub().

35  {
36  $this->createCellStub();
37  $binder = new PHPExcel_Cell_DefaultValueBinder();
38  $result = $binder->bindValue($this->cellStub, $value);
39  $this->assertTrue($result);
40  }
$result
+ Here is the call graph for this function:

◆ testDataTypeForRichTextObject()

DefaultValueBinderTest::testDataTypeForRichTextObject ( )

Definition at line 76 of file DefaultValueBinderTest.php.

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

77  {
79  $objRichText->createText('Hello World');
80 
81  $expectedResult = PHPExcel_Cell_DataType::TYPE_INLINE;
82  $result = call_user_func(array('PHPExcel_Cell_DefaultValueBinder','dataTypeForValue'), $objRichText);
83  $this->assertEquals($expectedResult, $result);
84  }
$result
$objRichText
Create styles array
The data for the language used.

◆ testDataTypeForValue()

DefaultValueBinderTest::testDataTypeForValue ( )

providerDataTypeForValue

Definition at line 63 of file DefaultValueBinderTest.php.

References $result, and array.

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  }
$result
Create styles array
The data for the language used.

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: