Questions tagged [atoum]

This tag is for questions about atoum, a programmer-oriented testing framework for PHP. It is a modern unit testing framework designed to be more simple and intuitive than xUnit frameworks.

#Summary According to the atoum documentation

atoum is a simple, modern and intuitive unit testing framework for PHP! It is completely standalone, everything is available and works out of the box.

#Quick info & Links

Homepage: https://atoum.org/

Documentation: https://docs.atoum.org/

GitHub: https://github.com/atoum/atoum/

#Installing atoum

##Installation via PHAR

$ wget http://downloads.atoum.org/nightly/atoum.phar
$ php atoum.phar

##Installation via Composer

For a global install, execute:

$ composer global require "atoum/atoum=^3.2"

To install atoum for your project, add the following lines in your project's composer.json file:

{    
  "require-dev": {       
    "atoum/atoum": "^3.2"
  }
}

Or use the composer command :

$ composer require --dev atoum/atoum

#Basic test sample

<?php
$this
    ->given($computer = new computer())
    ->if($computer->prepare())
    ->and(
        $computer->setFirstOperand(2),
        $computer->setSecondOperand(2)
    )
    ->then
        ->object($computer->add())
            ->isIdenticalTo($computer)
        ->integer($computer->getResult())
            ->isEqualTo(4)
;
5 questions
5
votes
1 answer

PhpStorm - Issue with Xdebug : Cannot find file '/project_path/Standard input code' locally on test file

I'm struggling to get Xdebug to work in a PHP test file on PhpStorm 2020. I need to debug some tests class along with the Xdebug extension, but I always get this : Cannot find file '/project_path/Standard input code' locally. To fix it set server…
naspy971
  • 1,137
  • 2
  • 13
  • 31
1
vote
1 answer

Mocking a series of methods with atoum

I am trying to design a Database($db) Mock with Atoum that would return different values depending on previous method calls (and arguments). I'm using PHP 5.6 and Atoum 3.2 Here is what I tried: $this->calling($db)->select = function($table, array…
ClemB
  • 87
  • 1
  • 11
1
vote
1 answer

Travis CI, Atoum and Coveralls for a PHP project

Fairly new to the CI game. I'm trying to get Travis CI and Coveralls working together and having a bit of trouble with it. The project in question is written in PHP and being tested with Atoum. My current .travis.yml file contains the following and…
Speedy
  • 467
  • 1
  • 6
  • 16
0
votes
1 answer

Concerning test cases with Atoum for PHP code , how can I unit test a class which uses require_once?

I can use Atoum to unit test a class as following:
AndroidHV
  • 369
  • 1
  • 9
0
votes
1 answer

trying to make atoum work for old project in php 5.2 like @rebolon said

In this article, rebolon reach to make works atoum and old php class http://rebolon.tumblr.com/post/44208304360/atoum-et-une-classe-codee-en-php-5-2 I try to but wuth atoum phar without success atoum/mageekguy.atoum.phar MyClass52.php