PHPackages                             sakharovmaksim/annotation-processor - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [Testing &amp; Quality](/categories/testing)
4. /
5. sakharovmaksim/annotation-processor

ActiveLibrary[Testing &amp; Quality](/categories/testing)

sakharovmaksim/annotation-processor
===================================

Utility for parsing constants from the description of the test methods. Created by tutu.ru

1.0.3(7y ago)19.1kMITPHPPHP ^7.1

Since May 16Pushed 7y ago2 watchersCompare

[ Source](https://github.com/sakharovmaksim/annotation-processor)[ Packagist](https://packagist.org/packages/sakharovmaksim/annotation-processor)[ RSS](/packages/sakharovmaksim-annotation-processor/feed)WikiDiscussions master Synced 1mo ago

READMEChangelog (4)Dependencies (2)Versions (5)Used By (0)

Annotation Processor — utility for parsing constants from the description of test methods
=========================================================================================

[](#annotation-processor--utility-for-parsing-constants-from-the-description-of-test-methods)

Install
-------

[](#install)

### 1. Download project from the repository

[](#1-download-project-from-the-repository)

Navigate to the directory where you want to store the directory with project. For instance, your home directory `cd ~`.

`git clone git@github.com:sakharovmaksim/annotation-processor.git`

And when downloading is done, navigate to the project directory `cd annotation-processor`.

### 2. Install dependencies

[](#2-install-dependencies)

`composer install`

Usage
-----

[](#usage)

### 1. In your TestCase class

[](#1-in-your-testcase-class)

In your TestCase class, in setUp() method, which extends from \\PHPUnit\\Framework\\TestCase create and use function like:

```
public function setUp()
{
	$this->_processAnnotations();
}

private function _processAnnotations()
{
	$class = get_class($this);
	$methodName = $this->getName(false);
	$annotationProcessor = new AnnotationProcessor($class, $methodName);
	// @domains
	if ($domainsExcept = $annotationProcessor->process(new Annotation\ArrayAnnotation(AnnotationsNames::DOMAINS_EXCEPT)))
	{
		if (Env::isRC() && in_array(Env::RC, $domainsExcept))
		{
			$this->markTestSkipped("Skip the test that is not for RC: {$class}::{$methodName}");
		}
		elseif (Env::isProduction() && in_array(Env::PROD, $domainsExcept))
		{
			$this->markTestSkipped("Skip the test that is not for Production: {$class}::{$methodName}");
		}
		elseif (Env::isStand() && in_array(Env::STAND, $domainsExcept))
		{
			$this->markTestSkipped("Skip the test that is not for stands: {$class}::{$methodName}");
		}
	}
	// @bug
	if ($annotationProcessor->process(new Annotation\BoolAnnotation(AnnotationsNames::BUG)))
	{
		$this->markTestSkipped("Skip the test {$class}::{$methodName}, because it has deactivated due to a @bug!");
	}
	// @todocase
	if ($annotationProcessor->process(new Annotation\BoolAnnotation(AnnotationsNames::TODOCASE)))
	{
		$this->markTestSkipped("Skip the test {$class}::{$methodName}, because it has @todocase, write it!");
	}
}

```

This function, when starting each test, will analyze the constants from the description and apply the actions described in the function above.

### 2. Create AnnotationsNames file with annotation constants

[](#2-create-annotationsnames-file-with-annotation-constants)

Use constants in \_processAnnotations()

```
class AnnotationsNames
{
	const DOMAINS_EXCEPT = '@domainsExcept';
	const BUG = '@bug';
	const TODOCASE = '@todocase';
}

```

### 3. Usage in tests annotations

[](#3-usage-in-tests-annotations)

```
/**
 * @labels Labels::RELEASE
 * @todocase Проверка поиска "Только туда"
 */
public function testSearchOW() {}

```

### 4. Run unit-tests for project

[](#4-run-unit-tests-for-project)

`sh run_tests.sh`

### 5. Deploy

[](#5-deploy)

Travis CI run unit-tests for all Pull Requests. Look '.travis.yml'-file with CI-config

---

Created by tutu.ru

###  Health Score

31

—

LowBetter than 68% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity23

Limited adoption so far

Community8

Small or concentrated contributor base

Maturity61

Established project with proven stability

 Bus Factor1

Top contributor holds 100% of commits — single point of failure

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

###  Release Activity

Cadence

Every ~0 days

Total

4

Last Release

2914d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/59161f20befc5ddfcbb7744283abd80ae0be3c8ce2a378efb3fda5c5680a9c6e?d=identicon)[sakharov.maksim](/maintainers/sakharov.maksim)

---

Top Contributors

[![sakharovmaksim](https://avatars.githubusercontent.com/u/17139166?v=4)](https://github.com/sakharovmaksim "sakharovmaksim (26 commits)")

---

Tags

annotation-processorannotationsdescriptionphpunitphpunit-teststesttest-managementtesting-toolsui-tests

### Embed Badge

![Health badge](/badges/sakharovmaksim-annotation-processor/health.svg)

```
[![Health](https://phpackages.com/badges/sakharovmaksim-annotation-processor/health.svg)](https://phpackages.com/packages/sakharovmaksim-annotation-processor)
```

###  Alternatives

[orchestra/testbench

Laravel Testing Helper for Packages Development

2.2k39.1M32.0k](/packages/orchestra-testbench)[timacdonald/log-fake

A drop in fake logger for testing with the Laravel framework.

4235.9M54](/packages/timacdonald-log-fake)[jasonmccreary/laravel-test-assertions

A set of helpful assertions when testing Laravel applications.

3513.9M31](/packages/jasonmccreary-laravel-test-assertions)[ergebnis/phpunit-slow-test-detector

Provides facilities for detecting slow tests in phpunit/phpunit.

1468.1M72](/packages/ergebnis-phpunit-slow-test-detector)[typo3/testing-framework

The TYPO3 testing framework provides base classes for unit, functional and acceptance testing.

675.0M774](/packages/typo3-testing-framework)[robiningelbrecht/phpunit-pretty-print

Prettify PHPUnit output

76460.0k15](/packages/robiningelbrecht-phpunit-pretty-print)

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
