vendor/phpoffice/phpexcel/unitTests/Classes/PHPExcel/Cell/HyperlinkTest.php

(开头部分) 1KB

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

<?php


class HyperlinkTest 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 testGetUrl()
	{
		$urlValue = 'http://www.phpexcel.net';

		$testInstance = new PHPExcel_Cell_Hyperlink($urlValue);

		$result = $testInstance->getUrl();
		$this->assertEquals($urlValue,$result);
	}

	public function testSetUrl()
	{
		$initialUrlValue = 'http://www.phpexcel.net';
		$newUrlValue = 'http://github.com/PHPOffice/PHPExcel';

		$testInstance = new PHPExcel_Cell_Hyperlink($initialUrlValue);
		$result = $testInstance->setUrl($newUrlValue);
		$this->assertTrue($result instanceof PHPExcel_Cell_Hyperlink);

		$result = $testInstance->getUrl();
		$this->assertEquals($newUrlValue,$result);
	}

	public function testGetTooltip()
	{
		$tooltipValue = 'PHPExcel Web Site';

		$testInstance = new PHPExcel_Cell_Hyperlink(NULL, $tooltipValue);

		$result = $testInstance->getTooltip();
		$this->assertEquals($tooltipValue,$result);
	}

	public function testSetTooltip()
	{
		$initialTooltipValue = 'PHPExcel Web Site';
		$newTooltipValue = 'PHPExcel Repository on Github';

		$testInstance = new PHPExcel_Cell_Hyperlink(NULL, $initialTooltipValue);
		$result = $testInstance->setTooltip($newTooltipValue);
		$this->assertTrue($result instanceof PHPExcel_Cell_Hyperlink);

		$result = $testInstance->getTooltip();
		$this->assertEquals($newTooltipValue,$result);
	}

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

AI 解读 AI

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

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