File tree Expand file tree Collapse file tree 3 files changed +31
-2
lines changed
Foundation/Testing/Concerns Expand file tree Collapse file tree 3 files changed +31
-2
lines changed Original file line number Diff line number Diff line change @@ -76,10 +76,14 @@ public function setUpRedis()
76
76
*/
77
77
public function tearDownRedis ()
78
78
{
79
- $ this ->redis ['phpredis ' ]->connection ()->flushdb ();
79
+ if (isset ($ this ->redis ['phpredis ' ])) {
80
+ $ this ->redis ['phpredis ' ]->connection ()->flushdb ();
81
+ }
80
82
81
83
foreach ($ this ->redisDriverProvider () as $ driver ) {
82
- $ this ->redis [$ driver [0 ]]->connection ()->disconnect ();
84
+ if (isset ($ this ->redis [$ driver [0 ]])) {
85
+ $ this ->redis [$ driver [0 ]]->connection ()->disconnect ();
86
+ }
83
87
}
84
88
}
85
89
Original file line number Diff line number Diff line change @@ -304,4 +304,15 @@ public function compileEndOnce()
304
304
{
305
305
return '<?php endif; ?> ' ;
306
306
}
307
+
308
+ /**
309
+ * Compile a checked block into valid PHP.
310
+ *
311
+ * @param string $condition
312
+ * @return string
313
+ */
314
+ protected function compileChecked ($ condition )
315
+ {
316
+ return "<?php if {$ condition }: echo 'checked'; endif; ?> " ;
317
+ }
307
318
}
Original file line number Diff line number Diff line change
1
+ <?php
2
+
3
+ namespace Illuminate \Tests \View \Blade ;
4
+
5
+ class BladeCheckedStatementsTest extends AbstractBladeTestCase
6
+ {
7
+ public function testCheckedStatementsAreCompiled ()
8
+ {
9
+ $ string = '<input @checked(name(foo(bar)))/> ' ;
10
+ $ expected = "<input <?php if(name(foo(bar))): echo 'checked'; endif; ?>/> " ;
11
+
12
+ $ this ->assertEquals ($ expected , $ this ->compiler ->compileString ($ string ));
13
+ }
14
+ }
You can’t perform that action at this time.
0 commit comments