I need to use unit testing in laravel but they need to download library laravel/browser-kit-testing
When i download it tell me they need php 5.6
And i using php 5.4.
public function testBasicTest()
{
$this->visit('/home')
->seePageIs('/login');
$response = $this->call('GET', '/dradmin');
$this->assertEquals(200, $response->status());
$this->visit('/login')
->type('[email protected]', 'email')
->type('123456', 'password')
->press('Login')
->seePageIs('/home');
}
}
when use phpunit
Error: Call to undefined method Tests\Feature\UserTest::visit()
/Users/mahmoud310/ecare/tests/Feature/UserTest.php:21
I read in other problems Laravel 5.4 HTTP testing - method seeInElement
use command laravel/browser-kit-testing can solve problem
in my case not work
Using version ^1.0 for laravel/browser-kit-testing
./composer.json has been updated
Loading composer repositories with package information
Updating dependencies (including require-dev)
Your requirements could not be resolved to an installable set of packages.
Problem 1
- The requested package phpunit/phpunit (locked at 5.7.19, required as 4.8.*) is satisfiable by phpunit/phpunit[5.7.19] but these conflict with your requirements or minimum-stability.
Problem 2
- Conclusion: don't install phpunit/phpunit 4.8.35
...
- Conclusion: don't install phpunit/phpunit 4.8.1
- phpunit/phpunit 4.8.0 conflicts with phpunit/phpunit-mock-objects[3.4.3].
...
- phpunit/phpunit 4.8.0 conflicts with phpunit/phpunit-mock-objects[3.4.3].
- Installation request for phpunit/phpunit 4.8.* -> satisfiable by phpunit/phpunit[4.8.0, 4.8.1, ..., 4.8.9].
- Installation request for phpunit/phpunit-mock-objects (locked at 3.4.3) -> satisfiable by phpunit/phpunit-mock-objects[3.4.3].
Installation failed, reverting ./composer.json to its original content.
./vendor/phpunit/phpunit/phpunitcomposer installto install laravel dependency