vendor/phpoffice/phpexcel/unitTests/Classes/PHPExcel/CellTest.php

(开头部分) 1KB

这里只显示每个文件的开头 60 行。登录后可以解锁完整代码。

<?php


require_once 'testDataFileIterator.php';

class CellTest extends PHPUnit_Framework_TestCase
{

    public function setUp()
    {
        if (!defined('PHPEXCEL_ROOT')) {
            define('PHPEXCEL_ROOT', APPLICATION_PATH . '/');
        }
        require_once(PHPEXCEL_ROOT . 'PHPExcel/Autoloader.php');
	}

    /**
     * @dataProvider providerColumnString
     */
	public function testColumnIndexFromString()
	{
		$args = func_get_args();
		$expectedResult = array_pop($args);
		$result = call_user_func_array(array('PHPExcel_Cell','columnIndexFromString'),$args);
		$this->assertEquals($expectedResult, $result);
	}

    public function providerColumnString()
    {
    	return new testDataFileIterator('rawTestData/ColumnString.data');
	}

    public function testColumnIndexFromStringTooLong()
	{
		$cellAddress = 'ABCD';
		try {
			$result = call_user_func(array('PHPExcel_Cell','columnIndexFromString'),$cellAddress);
		} catch (PHPExcel_Exception $e) {
			$this->assertEquals($e->getMessage(), 'Column string index can not be longer than 3 characters');
			return;
		}
		$this->fail('An expected exception has not been raised.');
	}

    public function testColumnIndexFromStringTooShort()
	{
		$cellAddress = '';
		try {
			$result = call_user_func(array('PHPExcel_Cell','columnIndexFromString'),$cellAddress);
		} catch (PHPExcel_Exception $e) {
			$this->assertEquals($e->getMessage(), 'Column string index can not be empty');
			return;
		}
		$this->fail('An expected exception has not been raised.');
	}

    /**
     * @dataProvider providerColumnIndex
     */
	public function testStringFromColumnIndex()

24 小时内免费解锁 3 个项目,之后 1 算力/个。 规则说明

AI 解读 AI

登录后可用,每次 10 算力,解读结果公开显示在下面。

还没有人解读过这个文件。