<?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);
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 testAssertArraySubsetRaisesExceptionForInvalidArguments($partial, $subject)
{
$this->assertArraySubset($partial, $subject);
}
/**
* @return array
*/
public function assertArraySubsetInvalidArgumentProvider()
{
return array(
array(false, array()),
array(arra
没有合适的资源?快使用搜索试试~ 我知道了~
基于PHP、JavaScript、CSS、HTML、Shell的多语言点菜系统设计源码
共2000个文件
php:1011个
js:154个
phpt:136个
1.该资源内容由用户上传,如若侵权请联系客服进行举报
2.虚拟产品一经售出概不退款(资源遇到问题,请及时私信上传者)
2.虚拟产品一经售出概不退款(资源遇到问题,请及时私信上传者)
版权申诉
0 下载量 167 浏览量
2024-09-29
14:50:17
上传
评论
收藏 21.32MB ZIP 举报
温馨提示
本项目是一款综合运用PHP、JavaScript、CSS、HTML、Shell等多语言技术构建的多语言点菜系统设计源码。该系统包含2608个文件,其中PHP文件1525个,JavaScript文件154个,CSS文件54个,HTML文件未知,Shell脚本文件未知。此外,还包括多种类型的文件,如文本、图像、文档配置等。该点菜系统旨在提供便捷的点餐服务。
资源推荐
资源详情
资源评论
收起资源包目录
基于PHP、JavaScript、CSS、HTML、Shell的多语言点菜系统设计源码 (2000个子文件)
weibo.data.bak 204KB
phpunit.bat 113B
[project_auto]course.bat 93B
run_bat.bat 86B
test.bmp 0B
bootstrap.min.css 125KB
bootstrap.min.css 118KB
bootstrap.min.css 115KB
layui.css 31KB
wangEditor.css 18KB
wangEditor.min.css 15KB
layer.css 14KB
layer.css 14KB
umeditor.css 14KB
style.css 10KB
chat_online.css 9KB
global.css 9KB
nv.d3.min.css 9KB
layui.mobile.css 8KB
laydate.css 8KB
shCoreEclipse.css 8KB
shCoreDjango.css 7KB
shCoreFadeToGrey.css 7KB
shCoreDefault.css 7KB
shCoreMidnight.css 7KB
shCoreRDark.css 7KB
shCoreEmacs.css 7KB
shCoreMDUltra.css 7KB
markdown.css 7KB
markdown.css 7KB
shCore.css 5KB
layer.css 5KB
cropper.min.css 4KB
drag.css 4KB
article.css 4KB
shThemeEclipse.css 3KB
shThemeDjango.css 2KB
shThemeFadeToGrey.css 2KB
shThemeVisualStudio.css 2KB
board.css 2KB
shThemeDefault.css 2KB
shThemeMidnight.css 2KB
shThemeRDark.css 2KB
shThemeEmacs.css 2KB
shThemeMDUltra.css 2KB
prettify.css 2KB
icons.css 2KB
style.css 2KB
shThemeAppleScript.css 2KB
main.css 2KB
laypage.css 1KB
search.css 1KB
style.css 1KB
code.css 1KB
statistics_out.css 708B
prettify.css 675B
categroy.css 665B
index.css 616B
ConfigForm.css 301B
comment.css 0B
weibo.data 43KB
emotions.data 29KB
dashboard.html.dist 7KB
file.html.dist 3KB
TestCaseMethod.tpl.dist 3KB
directory.html.dist 2KB
mocked_class.tpl.dist 1KB
phpunit.xml.dist 903B
file_item.html.dist 871B
phpmd.xml.dist 845B
phpmd.xml.dist 845B
phpunit.xml.dist 836B
phpunit.xml.dist 830B
directory_item.html.dist 821B
phpunit.xml.dist 803B
phpunit.xml.dist 773B
Migration.template.php.dist 756B
proxied_method.tpl.dist 716B
phpunit.xml.dist 681B
phpunit.xml.dist 677B
phpunit.xml.dist 661B
phpunit.xml.dist 658B
phpunit.xml.dist 654B
mocked_method.tpl.dist 644B
method_item.html.dist 632B
phpunit.xml.dist 619B
phpunit.xml.dist 531B
phpunit.xml.dist 446B
Seed.template.php.dist 326B
coverage_bar.html.dist 305B
mocked_class_method.tpl.dist 237B
wsdl_class.tpl.dist 179B
unmocked_clone.tpl.dist 159B
mocked_static_method.tpl.dist 151B
mocked_clone.tpl.dist 132B
wsdl_method.tpl.dist 60B
trait_class.tpl.dist 55B
iconfont.eot 52KB
glyphicons-halflings-regular.eot 20KB
glyphicons-halflings-regular.eot 20KB
共 2000 条
- 1
- 2
- 3
- 4
- 5
- 6
- 20
资源评论
lly202406
- 粉丝: 2823
- 资源: 5456
上传资源 快速赚钱
- 我的内容管理 展开
- 我的资源 快来上传第一个资源
- 我的收益 登录查看自己的收益
- 我的积分 登录查看自己的积分
- 我的C币 登录后查看C币余额
- 我的收藏
- 我的下载
- 下载帮助
最新资源
- json的合法基色来自红包东i请各位
- 项目采用YOLO V4算法模型进行目标检测,使用Deep SORT目标跟踪算法 .zip
- 针对实时视频流和静态图像实现的对象检测和跟踪算法 .zip
- 部署 yolox 算法使用 deepstream.zip
- 基于webmagic、springboot和mybatis的MagicToe Java爬虫设计源码
- 通过实时流协议 (RTSP) 使用 Yolo、OpenCV 和 Python 进行深度学习的对象检测.zip
- 基于Python和HTML的tb商品列表查询分析设计源码
- 基于国民技术RT-THREAD的MULTInstrument多功能电子测量仪器设计源码
- 基于Java技术的网络报修平台后端设计源码
- 基于Python的美食杰中华菜系数据挖掘与分析设计源码
资源上传下载、课程学习等过程中有任何疑问或建议,欢迎提出宝贵意见哦~我们会及时处理!
点击此处反馈
安全验证
文档复制为VIP权益,开通VIP直接复制
信息提交成功