Questions tagged as 'phpunit'

1
answer

Problem in autoload under test with PHPUnit and Composer in Windows

I'm having a problem with Composer in Windows 7. I developed a project with the following structure: Simpla_HTML |--/src | |--/Simpla | |--/Html | |--/Element.php /---tests | |--/Simpla | |--/Html |...
asked by 28.10.2015 / 15:50
2
answers

How to check if the class was instantiated through the DataProvider using PHP Unit

Could anyone make an example? Considering my class below: class MinhaClasse { private $param; public function __construct($params = []) { return null; } } I have my test class: require_once "MinhaClasse.php"; clas...
asked by 02.09.2015 / 15:08
0
answers

Testing Magical Methods in PHP UNIT

Hello. I need to test the magic methods in PHP UNIT. I'm using the Slim Framework framework What are they? __set() __get() __construct() __invoke() handle()     
asked by 14.08.2018 / 18:17
0
answers

PHPUnit + Crontab

I would like to know if it is possible to create some kind of cron in PHP that runs PHPUnit tests every x hours, I already searched in several places but still did not find the answer     
asked by 02.06.2018 / 01:56
1
answer

Phpunit: What is the best way to test a list?

I'm doing it this way, but it gives error: public function test_get_list_without_criteria() { $data = ["specialist_name" => "o especialista"]; $data2 = ["specialist_name" => "o especialista 2"]; $data3 = ["specialist_name" =&...
asked by 31.05.2018 / 20:07
0
answers

How to test Graphql in the Laravel framework

I'm creating an application in Laravel 5.6 with Graphql, from this library: link I was able to generate everything normally, but I'm having a hard time creating unit tests for application. Any alternative how to test my requests for Grap...
asked by 26.05.2018 / 08:50
0
answers

How to add Laravel's HTTP-Tests in a PHP package?

I am creating a package in PHP, with the composer by the time it is published in the Packagist . This package consists of many requests in other APIs, in which case I'm using Guzzle . To run the tests on phpunit that helps test th...
asked by 04.05.2018 / 03:53
0
answers

PHPUnit testing class without constructor

I'm developing unit tests on a project and I came across a class that does not contain constructor. You may wonder, "How does this object exist then?" Well, in another system, this object is generated and saved in a database, so in the sys...
asked by 20.04.2018 / 21:49
1
answer

Updating phpunit v5.1 to v6.5

Hello, I'm updating phpunit from a version 5.1 to 6.5 system, but from the update, the tests that were all working successfully, started to fail. The error message is:    1) Tests \ Administration \ Controller \ StudentControllerTest :: te...
asked by 19.03.2018 / 20:43
0
answers

CodeIgniter with PHPUnit

I'm trying to apply PHPUnit in my project with CodeIgniter, based on the following example ( link ), until then when the installation and dependency files are all ok, only when I add setUp () method. <?php class ApiTest extends PHPUnit_Fram...
asked by 18.02.2018 / 02:17