forked from spencer-mortensen/lens
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathTODO
More file actions
169 lines (126 loc) · 4.89 KB
/
TODO
File metadata and controls
169 lines (126 loc) · 4.89 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
BROKEN:
<?php
namespace Example;
use DateTime;
class Clock
{
public function getTime()
{
$time = new DateTime();
return $time->format('g:i a');
}
public function getLastErrors()
{
return DateTime::getLastErrors();
}
public function getShellTime()
{
$command = "date '+%_I:%M %P'";
return \shell_exec($command);
}
public function getDinnerTime()
{
$command = "date '+%_I:%M %P'";
return shell_exec($command);
}
}
function shell_exec($command)
{
return 'now';
}
------
Lens: update the Composer autoloader (currently version-specific); add instructions to the Guide
Lens: fix the issue where an extra mock statement can cause a test to unexpectedly pass
Lens: scanning algorithm also executes examples
------
Cache: clear when upgrading Lens
Cache: clear when switching between the phar and Composer executables
------
Before: "new Object(); // return null;"
After: "new Object();"
------
Consider the mock/live decision algorithm (currently very fragile)
# Support PDO queries:
$pdo = new PDO('...'); // return null;
$pdo->query('SELECT * FROM `server` where serverId = 1234 LIMIT 1'); // return new PDOStatement();
------
Lens: in "// Effects", support "global $x, $y;"
------
Code coverage: update the progress bars
Code coverage: infer the base namespace directory
Move binary files out of GitHub
======
QA Testing:
* Try all of the web examples from the Lens guide
* Try all commands on Linux, Mac, and Windows
* Try all commands with "fork" and "shell" engines
* Try Lens with xdebug both enabled and disabled
* Try the simple test
* Try the Composer autoloader
Website: Re-enable the Google analytics script
Watch the Packagist download counter.
======
PhpStorm: offers the "cache" and "live" versions of the class (but they are never useful)
PhpStorm: shows incorrect syntax highlighting
PhpStorm: in the "settings.yml" file, in the mock lists, PhpStorm doesn't update these namespaces when you refactor code
Lens: allow the user to autoload files that are only used during testing
Tests file: "use Example\{A, B};" <-- this syntax was expected to work, but didn't
Guide: explain where dependencies should be created for dependency injection (Bryan tried to instantiate a mock in the "// Test" section)
Guide: demonstrate the PDO / PDOStatement scenario
Lens: add clover reports (for "codecov" integration)
Lens: display backtrace along with exception (so we can debug more easily)
------
Attend sales demo with Ian Gillespie
Arrange lunch with Matt Richards
------
Cache: clear when the PHP version changes
Cache: clear when the autoloader is updated
Cache: clear when the autoload file itself is modified
------
Code coverage: use a local font file
Code coverage: absorb the is-xdebug-disabled code from the "Web" class
Code coverage: delete the "Web" class
------
Replace YAML library
Update the "parser" dependency
In "html": update the unit tests
In "regular-expressions": clean up everything
In "parser": Make the parsing fast (or use a third-party parser?)
Build: When creating the example zip files, convert tabs to spaces.
=== Product Backlog ===
Mock class constants and public properties
Increase the parsing speed, so the initial cache building will finish more quickly
Allow an empty "// Effect" section at the end of a tests file
Make the "// Effect" section optional
When running Lens with no tests, display an error message? (Right now: you see only whitespace)
Get code coverage to work with functions (idea: wrap in class, use "eval")
Support all types of use statements
Support the "splat" operator in mocks
In the "TextReport" output, display the variable name that contains a resource value (e.g. "feof(resource(stream));" => "feof($a);")
Use the expected variable names in pass-by-reference function calls (not the variable names from the source-code declaration) (e.g. "exec('zpool status 2> /dev/null', $output, $return_value); // $output = array(); $return_value = 0; return null;")
Cache test results
When checking the pass/fail status of a test, make sure that the correct resources were used (i.e. take the resource IDs into account)
Give user awareness when Lens is being very slow (e.g. when building a cache)
--- Ideas ---
Display better error messages when the script is invalid (e.g. "file_exists('/tmp'); // return true" <-- missing semicolon)
Allow any "// Effect" variables to be used in a script action?
Fork the telemetry call (so a slow network, or a slow web server, won't cause Lens to stall)
PhpStorm plugin: https://medium.com/@crocodile2u/running-phpunit-tests-in-phpstorm-7d486221e71a
======
Mock private methods
------
Levels of testing:
1. User testing (end-to-end behavior: user contract)
2. Unit testing (public interfaces: developer contract)
3. Private methods (entire codebase)
======
======
Start the unit test in a known state (including private properties)
------
$person = <Person
name: 'David Block'
ssn: '...'
age: ...
>
$person->method();
======