Answer the question
In order to leave comments, you need to log in
Is it possible to teach PHPUnit to understand dynamic extension classes?
Hey!
Let's say I'm a complete layman in the topic of automatic testing.
Let's say I installed PHPUnit.
I have a class
class Main {
public $tnt;
public function __construct() {
//тут я включаю автозагрузку
spl_autoload_register<...>;
//а затем... создаю инстанс нужной мне приблуды (в данном случае это Tarantool от mail.ru)
$this->tnt = Tarantool("localhost", "port_number");
}
}
Answer the question
In order to leave comments, you need to log in
1. Yes, I would get wet), but for this the constructor must be changed.
2. I think here the legs are dancing from the PHP settings.
Look in which environment your (php.ini) Main is running and in which phpunit is running.
If my telepathic abilities do not fail. Then your Main works with a web environment ( php-fpm or cgi, etc.), and phpunit works through php-cli. The whole difference is in the php.ini used
And most likely your extension is not connected in the second one
3. Xs, it all depends on the application logic
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question