* Build the foundation of a status command
* Apply fixes from StyleCI
* Wip testing status command
* Apply fixes from StyleCI
* Fix status test
* Apply fixes from StyleCI
* Fix race condition in creating test config file
* Apply fixes from StyleCI
* Reset container for each test
* Differentiate response code based on success or failure of status command
* Apply fixes from StyleCI
* Add the ability to test if a Brew service is running
* Apply fixes from StyleCI
* Check for more services running in status command
* Apply fixes from StyleCI
* Test Status
* Apply fixes from StyleCI
* Drop Yoast from base application test case
Co-authored-by: StyleCI Bot <bot@styleci.io>
* First attempt at testing CLI commands
* Apply fixes from StyleCI
* Protect from running locally
* Fix test
* wip
* wip
* wip
* wip
* wip
* Update app.php
* Create config folder and files for CLI tests
* Apply fixes from StyleCI
* Fix some formatting
* Fix imports
* Update all output() calls to use the writer passed in by the command
Ugly capture of all $outputs from commands, by passing them into `writer()` to be bound into the container, where they can then be pulled out from calls to `output()` and its buddies `info()`, `table()`, and `warning()`.
* Apply fixes from StyleCI
* Flesh out park command test
* Apply fixes from StyleCI
* Drop php 7.0 and 7.1
Co-authored-by: StyleCI Bot <bot@styleci.io>
Co-authored-by: Matt Stauffer <matt@tighten.co>
- Add --site to isolate
- Add --site to unisolate
- Refactor some tests
- Update Site@getSiteUrl to throw an exception instead of returning false
- Fix a few minor typos/grammatical issues
Update test suite to phpunit 9.5 syntax
Refactored to use polyfill for older PHP versions via `yoast/phpunit-polyfills`
Note: this includes 2 important differences from usual phpunit test suites:
- instead of extending `PHPUnit\Framework\TestCase` we extend `Yoast\PHPUnitPolyfills\TestCases\TestCase`
- instead of handling fixtures via `setUp()` and `tearDown()` we use `set_up()` and `tear_down()` respectively
Comment regarding formatting: I chose to use the FQDN in the `extends` syntax of the class declaration instead of using `use` so that it is more quickly apparent that we're doing something slightly different than usual phpunit syntax, particularly in regards to the set_up() / tear_down() methods that appear immediately following the `extends` line.
Updated the `proxies` method to return the URL + .tld
as the rendered output wasn't exactly what one would
expect. While not critical, it was not consistent.
Refactored some of the Site class to aid in testing using
a fake instead of relying on a ton of mocking.
The Site fake has support for both using `tests/output`
as well as named fixtures (`tests/fixtures/Proxies`).
Testing for certificate I/O is pretty whack, but this is
the best I could come up with that would still ensure
the certificate stuff was getting called without
actually requiring `sudo` to run phpunit.
Replaced instances referring directly to `VALET_HOME_PATH`
with calls to the new `valetHomePath()`. This method
is taken over in the fake Site implementation so
that everything runs the same using the fake
Site without having to change other
assumptions.
Updated several "path" methods (and many of their usages)
to take the "thing" you are looking for so you can
either get the path to the type of "thing" you
are looking for or the direct path to the
specific "thing" you are looking for.
Examples:
```
// ~/.config/valet/Nginx
$site->nginxPath();
// ~/.config/valet/Nginx/some-site.com.test
$site->nginxPath('some-site.com.test');
```
Made some other tests related to the existence of `Sites`
directory that resulted in updating the mocks for
many of the other tests.
All in all, it should make other aspects of the Site class
handle things more gracefully if `Sites` doesn't exist.