PHPackages                             maslosoft/codeception-reflection-asserts - 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. maslosoft/codeception-reflection-asserts

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

maslosoft/codeception-reflection-asserts
========================================

Reflection-based assertions for Codeception &amp; PHPUnit

1.0.0(6mo ago)0961MITPHPPHP &gt;=7.4

Since Nov 13Pushed 3mo agoCompare

[ Source](https://github.com/Maslosoft/codeception-reflection-asserts)[ Packagist](https://packagist.org/packages/maslosoft/codeception-reflection-asserts)[ RSS](/packages/maslosoft-codeception-reflection-asserts/feed)WikiDiscussions main Synced 1mo ago

READMEChangelogDependencies (1)Versions (2)Used By (1)

Codeception Reflection Asserts
==============================

[](#codeception-reflection-asserts)

This asserts module is prepared to test code generation tools to assert existing of classes, methods, properties.

### Installation and configuration

[](#installation-and-configuration)

Use composer to install:

```
composer require maslosoft/codeception-reflection-asserts --dev
```

Add to `tests/unit.suite.yml`:

```
actor: UnitTester
suite_namespace: Tests\Unit
modules:
    enabled:
      - \Maslosoft\Codeception\Module\ReflectionAsserts
```

### Usage

[](#usage)

#### Using in cest/cept

[](#using-in-cestcept)

```
$I->assertMethodExists(Foo::class, 'bar');
$I->assertMethodIsPublic(Foo::class, 'bar');
$I->assertPropertyExists(Foo::class, 'baz');
$I->assertPropertyIsPrivate(Foo::class, 'baz');
$I->assertMethodHasParameter(
    Foo::class,
    'bar',
    'limit',
    type: 'int',
    allowsNull: false,
    optional: true
);
```

#### Using in unit test

[](#using-in-unit-test)

```
