File tree Expand file tree Collapse file tree 2 files changed +19
-14
lines changed Expand file tree Collapse file tree 2 files changed +19
-14
lines changed Original file line number Diff line number Diff line change 42
42
"Codebarista\\ LaravelEssentials\\ Tests\\ " : " tests/"
43
43
}
44
44
},
45
+ "scripts" : {
46
+ "test" : " ./vendor/bin/pest"
47
+ },
45
48
"extra" : {
46
49
"laravel" : {
47
50
"providers" : [
Original file line number Diff line number Diff line change 1
1
<?php
2
2
3
+ it ('has the callable helpers ' , function () {
4
+ expect ('encode_json ' )->toBeCallable ()
5
+ ->and ('decode_json ' )->toBeCallable ()
6
+ ->and ('crush_png ' )->toBeCallable ()
7
+ ->and ('str_chop ' )->toBeCallable ();
8
+ });
9
+
3
10
it ('decodes json string to array ' , function () {
4
11
$ value = <<<'JSON'
5
12
{
26
33
})->covers ('encode_json ' );
27
34
28
35
it ('chops a string ' , function () {
29
- $ value = Str::random (42 );
30
-
31
- expect (str_chop ($ value , 20 ))
36
+ expect (str_chop (md5 (microtime ()), 20 ))
32
37
->toBeString ()
33
38
->toContain ('... ' )
34
39
->toHaveLength (23 );
35
40
36
41
})->covers ('str_chop ' );
37
42
38
- //it('can crush png', function () {
39
- // $version = null;
40
- //
41
- // if ($pngcrush = exec('which pngcrush')) {
42
- // $version = exec($pngcrush.' --version');
43
- // }
44
- //
45
- // expect($version)->toBeString();
46
- // // ->toContain('pngcrush');
47
- //
48
- //})->covers('crush_png');
43
+ it ('has pngcrush installed ' , function () {
44
+ exec (' LC_ALL=C type pngcrush ' , $ output , $ result );
45
+ expect ($ output )
46
+ ->toBeArray ()
47
+ ->and ($ result )
48
+ ->toBeInt ()
49
+ ->toBe (0 );
50
+ });
You can’t perform that action at this time.
0 commit comments