Weave Code
Code Weaver
Helps Laravel developers discover, compare, and choose open-source packages. See popularity, security, maintainers, and scores at a glance to make better decisions.
Feedback
Share your thoughts, report bugs, or suggest improvements.
Subject
Message

Stubs Laravel Package

atoum/stubs

IDE stubs for atoum providing PHPDoc annotations and full code completion without cluttering atoum’s core source. Install via Composer, use the atoum/mageekguy\atoum aliases in tests, and get richer autocompletion for the userland API.

View on GitHub
Deep Wiki
Context7

atoum stubs

atoum

Install it

Install extension using composer:

{
    "require-dev": {
        "atoum/stubs": "*"
    }
}

Use it

Once your IDE is correctly configured, the only thing you will have to do is use atoum through one of its alias:

<?php

// tests/units/random.php

namespace tests\units;

use atoum; // or mageekguy\atoum

class random extends atoum {
    // ...
}

atoum provides 3 aliases for the main test class, choose the one you prefer:

  • atoum
  • atoum\test
  • mageekguy\atoum

Once done, you will get full featured code-completion:

atoum-stubs

Why?

Why are the PHPdoc annotations part of an external repository?

Because we just don't want them in the middle of atoum's source code. It's not really useful there and it adds extra noise.

Moreover, if we use PHPDoc for the userland API we should also add annotations to every method of the internal API. Too much work for a small amount of added value.

Why are those annotations only working on atoum aliases?

Because we stored annotated code in an external repository, we would have to duplicate some classes to annotate them. Doing so would create duplicate classes and some IDEs will emit warnings.

We don't want to add extra noise while providing a good code-completion.

Why not annotating every public method?

Because they are not all meaningful in a test context. When you write unit tests with atoum, you will likely never call internal asserters' methods, even if they are public. They provide support for atoum so it can do its job well. But they won't help you in your everyday work.

Upgrade stubs

bin/updateMissingStubClasses
bin/updateDoc

This will only update existing methods. To add new method you will require to do it manually! Think also to look at the tree of asserters to extends the class properly.

You probably also need to update classes/mageekguy/atoum/stubs/asserters.php with the new asserter set.

License

atoum stubs are released under the BSD-3-Clause License. See the bundled LICENSE file for details.

Weaver

How can I help you explore Laravel packages today?

Conversation history is not saved when not logged in.
Prompt
Add packages to context
No packages found.
andydefer/laravel-cluster
testo/fiber
mintobit/jobqueue
a4sex/maintenance-bundle
a4sex/entity-date-update
a4sex/client-identifier
a4sex/base-utilites
a4sex/key-value-storage
a4sex/micro-status
chilldev/dependency-injection-extra
datinglibre/datinglibre-app-api
biberltd/corebundle
bricre/symfony-bundle-test
biberltd/logbundle
dominium/http-adapter-bundle
dominium/google-analytics
a4sex/auto-clean-entity
christhompsontldr/laravel-inky
spatie/mailcoach-vapor
spatie/laravel-javascript-views