vendor/phpoffice/phpexcel/unitTests/Classes/PHPExcel/Chart/LegendTest.php

(开头部分) 1KB

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

<?php


class LegendTest extends PHPUnit_Framework_TestCase
{

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

	public function testSetPosition()
	{
		$positionValues = array(
			PHPExcel_Chart_Legend::POSITION_RIGHT,
			PHPExcel_Chart_Legend::POSITION_LEFT,
			PHPExcel_Chart_Legend::POSITION_TOP,
			PHPExcel_Chart_Legend::POSITION_BOTTOM,
			PHPExcel_Chart_Legend::POSITION_TOPRIGHT,
		);

		$testInstance = new PHPExcel_Chart_Legend;

		foreach($positionValues as $positionValue) {
			$result = $testInstance->setPosition($positionValue);
			$this->assertTrue($result);
		}
	}

	public function testSetInvalidPositionReturnsFalse()
	{
		$testInstance = new PHPExcel_Chart_Legend;

		$result = $testInstance->setPosition('BottomLeft');
		$this->assertFalse($result);
		//	Ensure that value is unchanged
		$result = $testInstance->getPosition();
		$this->assertEquals(PHPExcel_Chart_Legend::POSITION_RIGHT,$result);
	}

	public function testGetPosition()
	{
		$PositionValue = PHPExcel_Chart_Legend::POSITION_BOTTOM;

		$testInstance = new PHPExcel_Chart_Legend;
		$setValue = $testInstance->setPosition($PositionValue);

		$result = $testInstance->getPosition();
		$this->assertEquals($PositionValue,$result);
	}

	public function testSetPositionXL()
	{
		$positionValues = array(
			PHPExcel_Chart_Legend::xlLegendPositionBottom,
			PHPExcel_Chart_Legend::xlLegendPositionCorner,

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

AI 解读 AI

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

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