<?php
/*
* This file is part of PHPUnit.
*
* (c) Sebastian Bergmann <sebastian@phpunit.de>
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/
/**
* @since Class available since Release 2.0.0
*/
class Framework_AssertTest extends PHPUnit_Framework_TestCase
{
/**
* @var string
*/
private $filesDirectory;
protected function setUp()
{
$this->filesDirectory = dirname(__DIR__) . DIRECTORY_SEPARATOR . '_files' . DIRECTORY_SEPARATOR;
}
/**
* @covers PHPUnit_Framework_Assert::fail
*/
public function testFail()
{
try {
$this->fail();
} catch (PHPUnit_Framework_AssertionFailedError $e) {
return;
}
throw new PHPUnit_Framework_AssertionFailedError('Fail did not throw fail exception');
}
/**
* @covers PHPUnit_Framework_Assert::assertContains
*/
public function testAssertSplObjectStorageContainsObject()
{
$a = new stdClass;
$b = new stdClass;
$c = new SplObjectStorage;
$c->attach($a);
$this->assertContains($a, $c);
try {
$this->assertContains($b, $c);
} catch (PHPUnit_Framework_AssertionFailedError $e) {
return;
}
$this->fail();
}
/**
* @covers PHPUnit_Framework_Assert::assertContains
*/
public function testAssertArrayContainsObject()
{
$a = new stdClass;
$b = new stdClass;
$this->assertContains($a, array($a));
try {
$this->assertContains($a, array($b));
} catch (PHPUnit_Framework_AssertionFailedError $e) {
return;
}
$this->fail();
}
/**
* @covers PHPUnit_Framework_Assert::assertContains
*/
public function testAssertArrayContainsString()
{
$this->assertContains('foo', array('foo'));
try {
$this->assertContains('foo', array('bar'));
} catch (PHPUnit_Framework_AssertionFailedError $e) {
return;
}
$this->fail();
}
/**
* @covers PHPUnit_Framework_Assert::assertContains
*/
public function testAssertArrayContainsNonObject()
{
$this->assertContains('foo', array(true));
try {
$this->assertContains('foo', array(true), '', false, true, true);
} catch (PHPUnit_Framework_AssertionFailedError $e) {
return;
}
$this->fail();
}
/**
* @covers PHPUnit_Framework_Assert::assertContainsOnlyInstancesOf
*/
public function testAssertContainsOnlyInstancesOf()
{
$test = array(
new Book(),
new Book
);
$this->assertContainsOnlyInstancesOf('Book', $test);
$this->assertContainsOnlyInstancesOf('stdClass', array(new stdClass()));
$test2 = array(
new Author('Test')
);
try {
$this->assertContainsOnlyInstancesOf('Book', $test2);
} catch (PHPUnit_Framework_AssertionFailedError $e) {
return;
}
$this->fail();
}
/**
* @covers PHPUnit_Framework_Assert::assertArrayHasKey
* @expectedException PHPUnit_Framework_Exception
*/
public function testAssertArrayHasKeyThrowsExceptionForInvalidFirstArgument()
{
$this->assertArrayHasKey(null, array());
}
/**
* @covers PHPUnit_Framework_Assert::assertArrayHasKey
* @expectedException PHPUnit_Framework_Exception
*/
public function testAssertArrayHasKeyThrowsExceptionForInvalidSecondArgument()
{
$this->assertArrayHasKey(0, null);
}
/**
* @covers PHPUnit_Framework_Assert::assertArrayHasKey
*/
public function testAssertArrayHasIntegerKey()
{
$this->assertArrayHasKey(0, array('foo'));
try {
$this->assertArrayHasKey(1, array('foo'));
} catch (PHPUnit_Framework_AssertionFailedError $e) {
return;
}
$this->fail();
}
/**
* @covers PHPUnit_Framework_Assert::assertArraySubset
* @covers PHPUnit_Framework_Constraint_ArraySubset
*/
public function testAssertArraySubset()
{
$array = array(
'a' => 'item a',
'b' => 'item b',
'c' => array('a2' => 'item a2', 'b2' => 'item b2'),
'd' => array('a2' => array('a3' => 'item a3', 'b3' => 'item b3'))
);
$this->assertArraySubset(array('a' => 'item a', 'c' => array('a2' => 'item a2')), $array);
$this->assertArraySubset(array('a' => 'item a', 'd' => array('a2' => array('b3' => 'item b3'))), $array);
$arrayAccessData = new ArrayObject($array);
$this->assertArraySubset(array('a' => 'item a', 'c' => array('a2' => 'item a2')), $arrayAccessData);
$this->assertArraySubset(array('a' => 'item a', 'd' => array('a2' => array('b3' => 'item b3'))), $arrayAccessData);
try {
$this->assertArraySubset(array('a' => 'bad value'), $array);
} catch (PHPUnit_Framework_AssertionFailedError $e) {
}
try {
$this->assertArraySubset(array('d' => array('a2' => array('bad index' => 'item b3'))), $array);
} catch (PHPUnit_Framework_AssertionFailedError $e) {
return;
}
$this->fail();
}
/**
* @covers PHPUnit_Framework_Assert::assertArraySubset
* @covers PHPUnit_Framework_Constraint_ArraySubset
*/
public function testAssertArraySubsetWithDeepNestedArrays()
{
$array = array(
'path' => array(
'to' => array(
'the' => array(
'cake' => 'is a lie'
)
)
)
);
$this->assertArraySubset(array('path' => array()), $array);
$this->assertArraySubset(array('path' => array('to' => array())), $array);
$this->assertArraySubset(array('path' => array('to' => array('the' => array()))), $array);
$this->assertArraySubset(array('path' => array('to' => array('the' => array('cake' => 'is a lie')))), $array);
try {
$this->assertArraySubset(array('path' => array('to' => array('the' => array('cake' => 'is not a lie')))), $array);
} catch (PHPUnit_Framework_AssertionFailedError $e) {
return;
}
$this->fail();
}
/**
* @covers PHPUnit_Framework_Assert::assertArraySubset
* @covers PHPUnit_Framework_Constraint_ArraySubset
*/
public function testAssertArraySubsetWithNoStrictCheckAndObjects()
{
$obj = new \stdClass;
$reference = &$obj;
$array = array('a' => $obj);
$this->assertArraySubset(array('a' => $reference), $array);
$this->assertArraySubset(array('a' => new \stdClass), $array);
}
/**
* @covers PHPUnit_Framework_Assert::assertArraySubset
* @covers PHPUnit_Framework_Constraint_ArraySubset
*/
public function testAssertArraySubsetWithStrictCheckAndObjects()
{
$obj = new \stdClass;
$reference = &$obj;
$array = array('a' => $obj);
$this->assertArraySubset(array('a' => $reference), $array, true);
try {
$this->assertArraySubset(array('a' => new \stdClass), $array, true);
} catch (PHPUnit_Framework_AssertionFailedError $e) {
return;
}
$this->fail('Strict recursive array check fail.');
}
/**
* @covers PHPUnit_Framework_Assert::assertArraySubset
* @covers PHPUnit_Framework_Constraint_ArraySubset
* @expectedException PHPUnit_Framework_Exception
* @expectedExceptionMessage array or ArrayAccess
* @dataProvider assertArraySubsetInvalidArgumentProvider
*/
public function testAssertArraySubsetRaisesExceptionForIn
没有合适的资源?快使用搜索试试~ 我知道了~
影视双端APP源码最新二开版带视频教程素材火版本
共3421个文件
php:1377个
js:560个
less:195个
4星 · 超过85%的资源 需积分: 42 43 下载量 85 浏览量
2018-12-25
10:35:12
上传
评论
收藏 25.56MB ZIP 举报
温馨提示
编译APP apicloud用到的五个模块 模块1 mcm 模块2 webBrowser 模块3 clipBoard 模块4 dialogBox 模块5 mam 编译APP教程在apicloud官网有详情教程,官网www.apicloud.com APP编译好之后 把安装包存为你app名字的拼音如kuxiang.apk 在把包上传到你网站根目录 后台地址/index.php/login/login 后台登入账号:admin 密码123456 服务器环境linux 环境 apache2.4 php5.6 phpmyadmin4.0
资源推荐
资源详情
资源评论
收起资源包目录
影视双端APP源码最新二开版带视频教程素材火版本 (3421个子文件)
09eedee51cf92f0a307b42651717b076cache 9KB
203a12b35f768736e88559badfa147a5cache 28KB
22af66e94c13b95d208913f86caceb44cache 395B
4c74519875a6f7c31aec5165d94337facache 28KB
521218e6eb08bb77af06ee33b4aebc75cache 71KB
65b34f0f376a998c89f9ad3374a2b75ecache 62KB
7d42db7d21da77641e268684675ee6f4cache 63KB
7ef1186cf47fcf85b048196b6feb2777cache 75KB
9501b1c9dc59dec2fc534a7f5f23b030cache 49KB
999d62597ddc051b0b4d7f7e2f24a468cache 28KB
9bfcbdb5b006e1aff73a6dd1bbf5b62dcache 49KB
9dbc441b85c8299339617bbcf930daaecache 64KB
a08ef8fd0ccedccf44af20ea4757ab86cache 237KB
a6198c7cb43759638785f37fd71ced04cache 49KB
b83fafd43049158c3bd8af0d530a039ccache 75KB
start_for_win.bat 134B
phpunit.bat 117B
bc7357863876fdd6099651fc6f391f2ccache 47KB
bebea3161a55678b99d8ecbb7a61bcafcache 395B
test.bmp 0B
c22a01dff49596cb493069fac36cccc8cache 395B
dx.ios.default.css 775KB
xenon.css 744KB
dx.ios7.default.css 311KB
xenon-skins.css 267KB
dx.win8.black.css 188KB
xenon-core.css 185KB
dx.win8.white.css 182KB
dx.light.css 174KB
dx.dark.css 170KB
xenon-components.css 164KB
uikit.gradient.css 150KB
dx.android.holo-light.css 148KB
dx.android.holo-dark.css 147KB
uikit.almost-flat.css 146KB
uikit.css 138KB
bootstrap.css 128KB
elusive-embedded.css 115KB
bootstrap.min.css 115KB
bootstrap.css 90KB
dx.common.css 90KB
uikit.css 84KB
uikit.gradient.min.css 84KB
uikit.almost-flat.min.css 81KB
bootstrap.min.css 79KB
uikit.min.css 75KB
xenon-forms.css 68KB
linecons-embedded.css 65KB
animate.min.css 60KB
uikit.css 48KB
meteocons-embedded.css 38KB
editor_ie7.css 37KB
editor_iequirks.css 36KB
editor_ie8.css 36KB
editor_ie.css 35KB
editor_gecko.css 35KB
editor.css 34KB
editor.css 34KB
uikit.gradient.addons.css 32KB
uikit.almost-flat.addons.css 31KB
elusive-ie7.css 28KB
uikit.addons.css 28KB
elusive-ie7-codes.css 28KB
font-awesome.css 26KB
font-awesome.min.css 21KB
fullcalendar.css 21KB
_all.css 20KB
select2.css 19KB
dialog_ie7.css 17KB
jquery.dataTables.css 17KB
dialog_ie8.css 17KB
dialog_iequirks.css 16KB
dialog_ie.css 16KB
elusive.css 16KB
dialog.css 16KB
uikit.gradient.addons.min.css 15KB
jquery.dataTables.min.css 15KB
elusive-codes.css 14KB
uikit.almost-flat.addons.min.css 14KB
layer.css 14KB
_all.css 14KB
_all.css 14KB
editor_ie7.css 14KB
editor_ie.css 13KB
editor_iequirks.css 13KB
editor_ie8.css 13KB
editor_gecko.css 13KB
uikit.addons.min.css 12KB
spectrum.css 12KB
_all.css 12KB
bootstrap-responsive.css 12KB
rwd-table.css 12KB
jquery.dataTables_themeroller.css 12KB
dropzone.css 11KB
rwd-table.min.css 11KB
dialog_ie.css 10KB
dataTables.tableTools.css 10KB
dialog_ie7.css 10KB
swiper.min.css 10KB
dialog_ie8.css 10KB
共 3421 条
- 1
- 2
- 3
- 4
- 5
- 6
- 35
资源评论
- 伊犁在线2019-10-29修修改可以用
weixin_43678751
- 粉丝: 0
- 资源: 1
上传资源 快速赚钱
- 我的内容管理 展开
- 我的资源 快来上传第一个资源
- 我的收益 登录查看自己的收益
- 我的积分 登录查看自己的积分
- 我的C币 登录后查看C币余额
- 我的收藏
- 我的下载
- 下载帮助
最新资源
- 毕业设计A052-基于Java的健身房管理系统的设计与实现
- 模型预测电流控制-广义双矢量
- Python爬虫入门推荐+爬取商品数据进行数据分析+适用于测试、开发、运营等
- libusbK、libusb-win32、libwdi、USB视频设备 驱动安装包
- 江苏范特科技有限公司创投信息
- 上海零数科技有限公司创投信息
- 上海唯鲜良品食品科技有限公司创投信息
- 上海柚凡信息科技有限公司创投信息
- 上海域圆信息科技有限公司创投信息
- 上市公司财务指标数据集2023-2000年原始数据 含剔除金融STPT版本
- Qt中嵌入窗口,例如嵌入MainWindows、QWidget、QDialog等窗口
- matplotShowDataCSV2-最简单的数据绘图
- 深圳店匠科技有限公司创投信息
- 深圳莱芒生物科技有限公司创投信息
- 沈阳黛斯蓝伊莎生物科技有限公司创投信息
- 苏州引航生物科技有限公司创投信息
资源上传下载、课程学习等过程中有任何疑问或建议,欢迎提出宝贵意见哦~我们会及时处理!
点击此处反馈
安全验证
文档复制为VIP权益,开通VIP直接复制
信息提交成功