我有一个无序列表,可以包含偶数或奇数的项目.我正在寻找一种仅限CSS的方法,li如果lis 的数量是偶数,则从最后2个标签中删除边界.在:last-child不考虑伪选择删除最后一个.
li {
float: left;
border-bottom: 1px solid #000;
}
li:last-child{
border-bottom: none;
}
Run Code Online (Sandbox Code Playgroud)
lis+============================================+
+ 1 | 2 +
+--------------------------------------------+
+ 3 | +
+============================================+
Run Code Online (Sandbox Code Playgroud)
+============================================+
+ 1 | 2 +
+--------------------------------------------+
+ 3 | 4 +
+--------------------- +
+============================================+
Run Code Online (Sandbox Code Playgroud)
所以我想我可以使用,li:nth-last-child()但我无法弄清楚应该是什么应该是抓住最后一个奇怪的孩子.
这不2n+1,2n-1,n-1,或任何我能想到的.请帮忙.
有没有人知道用PHPUnit区分FALSE和NULL的可靠方法?
我试图在断言中的返回值中区分NULL和FALSE.
这失败了:
$this->assertNotEquals(FALSE, NULL);
Run Code Online (Sandbox Code Playgroud)
这些断言通过:
$this->assertFalse(NULL);
$this->assertNull(FALSE);
Run Code Online (Sandbox Code Playgroud)
编辑:对于某些上下文,这是为了区分错误状态(FALSE)和空结果(NULL).为了确保功能正常返回,我需要区分这两者.谢谢
编辑...根据我正在测试的一些问题,我正在添加测试.
Class testNullFalse extends PHPUnit_Framework_TestCase{
public function test_null_not_false (){
$this->assertNotEquals(FALSE, NULL, "False and null are not the same");
}
public function test_null_is_false (){
$this->assertFalse(NULL, "Null is clearly not FALSE");
}
public function test_false_is_null (){
$this->assertNull(FALSE, "False is clearly not NULL");
}
public function test_false_equals_null(){
$this->assertEquals(FALSE, NULL, "False and null are not equal");
}
public function test_false_sameas_null(){
$this->assertSame(FALSE, NULL, "False and null are not the same");
}
public function test_false_not_sameas_null(){
$this->assertNotSame(FALSE, NULL, …Run Code Online (Sandbox Code Playgroud) 基本上,我一直在尝试nXhtml模式,它在Emacs 24中非常慢和错误.
我正在使用PHP文件.我想用*.phpas 加载大多数文件php-mode,但如果我正在访问的文件在'/templates'或'/views'文件夹中,请加载该文件html-mode.
重命名文件或更改项目结构不是选项.我正在使用24.1.1.我确信这是可能的,因此可以接受指向正确方向的合适的伪代码解决方案.