No Description

LookupRefTest.php 1.3KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253
  1. <?php
  2. require_once 'testDataFileIterator.php';
  3. class LookupRefTest extends PHPUnit_Framework_TestCase
  4. {
  5. public function setUp()
  6. {
  7. if (!defined('PHPEXCEL_ROOT'))
  8. {
  9. define('PHPEXCEL_ROOT', APPLICATION_PATH . '/');
  10. }
  11. require_once(PHPEXCEL_ROOT . 'PHPExcel/Autoloader.php');
  12. PHPExcel_Calculation_Functions::setCompatibilityMode(PHPExcel_Calculation_Functions::COMPATIBILITY_EXCEL);
  13. }
  14. /**
  15. * @dataProvider providerHLOOKUP
  16. */
  17. public function testHLOOKUP()
  18. {
  19. $args = func_get_args();
  20. $expectedResult = array_pop($args);
  21. $result = call_user_func_array(array('PHPExcel_Calculation_LookupRef','HLOOKUP'),$args);
  22. $this->assertEquals($expectedResult, $result);
  23. }
  24. public function providerHLOOKUP()
  25. {
  26. return new testDataFileIterator('rawTestData/Calculation/LookupRef/HLOOKUP.data');
  27. }
  28. /**
  29. * @dataProvider providerVLOOKUP
  30. */
  31. public function testVLOOKUP()
  32. {
  33. $args = func_get_args();
  34. $expectedResult = array_pop($args);
  35. $result = call_user_func_array(array('PHPExcel_Calculation_LookupRef','VLOOKUP'),$args);
  36. $this->assertEquals($expectedResult, $result);
  37. }
  38. public function providerVLOOKUP()
  39. {
  40. return new testDataFileIterator('rawTestData/Calculation/LookupRef/VLOOKUP.data');
  41. }
  42. }