Skip to content

andaniel05/PyramidalTests

Folders and files

NameName
Last commit message
Last commit date

Latest commit

c53547d · Mar 31, 2023
Jan 8, 2022
Feb 20, 2022
Dec 23, 2022
Dec 23, 2022
May 5, 2021
Dec 28, 2021
Oct 12, 2021
May 5, 2021
Feb 19, 2022
Feb 15, 2022
Mar 31, 2023
Mar 31, 2023
Jan 9, 2022

Repository files navigation

PyramidalTests

A complementary framework for PHPUnit that focuses on simplicity, reusability, and storytelling.

If you like this project gift us a ⭐.


Documentation.

Installation.

$ composer require --dev thenlabs/pyramidal-tests 2.0.x-dev

This project is still under development.

Example:

<?php
// tests/test-it-is-created-a-product.php

testCase('it is created a product', function () {
    setUp(function () {
        $this->product = new Product();
    });

    test('the product has not name', function () {
        $this->assertEmpty($this->product->getName());
    });

    test('not contains categories', function () {
        $this->assertCount(0, $this->product->getCategories());
    });

    testCase('adds a category to the product', function () {
        setUp(function () {
            $this->category = $this->createMock(Category::class);
            $this->product->addCategory($this->category);
        });

        test('the product contains the category', function () {
            $this->assertContains($this->category, $this->product->getCategories());
        });
    });
});

Executing:

$ ./vendor/bin/pyramidal --testdox

The --testdox argument is optional.

Result:

PyramidalTests 2.x.x by Andy Daniel Navarro Taño and contributors.
PHPUnit 9.5.x by Sebastian Bergmann and contributors.

it is created a product
✔ the product has not name
✔ not contains categories

    adds a category to the product
    ✔ the product contains the category

Time: 00:00.009, Memory: 6.00 MB

OK (3 tests, 3 assertions)

Development.

Running the tests.

$ composer test