PHPackages                             salsadigitalauorg/scaffold-testing - 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. salsadigitalauorg/scaffold-testing

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

salsadigitalauorg/scaffold-testing
==================================

Testing framework for Vortex scaffold

0.4.4(1y ago)05.4k↓47.7%[1 PRs](https://github.com/salsadigitalauorg/scaffold-testing/pulls)GPL-2.0-or-laterPHPPHP &gt;=8.3CI passing

Since Sep 6Pushed 4mo ago5 watchersCompare

[ Source](https://github.com/salsadigitalauorg/scaffold-testing)[ Packagist](https://packagist.org/packages/salsadigitalauorg/scaffold-testing)[ RSS](/packages/salsadigitalauorg-scaffold-testing/feed)WikiDiscussions main Synced 1mo ago

READMEChangelog (6)Dependencies (11)Versions (8)Used By (0)

Scaffold Testing
================

[](#scaffold-testing)

A testing framework for Vortex scaffold that provides automated test setup and configuration.

Installation
------------

[](#installation)

```
composer require salsadigitalauorg/scaffold-testing --dev
```

Configuration
-------------

[](#configuration)

Add the following configuration to your project's `composer.json`:

```
{
    "extra": {
        "scaffold-testing": {
            "target-dir": "tests/behat/",
            "files": {
                "homepage.feature": false,
                "login.feature": false,
                "search.feature": false,
                "contenttypes.feature": false
            },
            "override_feature": false,
            "override_feature_context": false
        }
    }
}
```

### Configuration Options

[](#configuration-options)

- `target-dir`: The directory where test files will be installed (default: `tests/behat/`)
- `files`: Specific feature files to install and their override settings
    - Key: Feature file name
    - Value: Boolean indicating whether to override if file exists
- `override_feature`: Global override setting for all feature files (default: `false`)
- `override_feature_context`: Whether to override the FeatureContext.php file (default: `false`)

### Examples

[](#examples)

1. Default Setup:

```
{
    "scaffold-testing": {
        "target-dir": "tests/behat/"
    }
}
```

2. Custom Directory:

```
{
    "scaffold-testing": {
        "target-dir": "custom/path/behat/"
    }
}
```

3. Specific Features with Override:

```
{
    "scaffold-testing": {
        "target-dir": "tests/behat/",
        "files": {
            "homepage.feature": true,
            "login.feature": false
        }
    }
}
```

4. Override All Features:

```
{
    "scaffold-testing": {
        "target-dir": "tests/behat/",
        "override_feature": true
    }
}
```

Development
-----------

[](#development)

See [README.developers.md](README.developers.md) for development setup and guidelines.

#### Overview

[](#overview)

The **Scaffold Testing Library** provides a set of default Behat tests tailored for Drupal projects, aiming to ensure consistent testing across different deployments. This library helps streamline the testing process by providing ready-to-use Behat test scenarios that cover common functionalities within Drupal sites.

#### Jumpstart Features

[](#jumpstart-features)

- **Home Page Test**: Ensures the homepage loads successfully and contains specific keywords or phrases.
- **Permissions Test**: Checks different user roles for appropriate access rights to content in various states (published, draft, in review).
- **Workflow Test**: Tests the expected moderation states and transitions between them.
- **Search Functionality Test**: Verifies that search indexing works and returns expected results.
- **Content Types Test**: Verifies that content types can be created.

#### Usage

[](#usage)

After installation, the Behat test files are placed in the `tests/behat/features/` directory of your Drupal project. You can run these tests using Behat with a command similar to:

```
vendor/bin/behat
```

Make sure you have configured Behat properly in your Drupal project to recognize and execute these tests.

#### Configuration

[](#configuration-1)

To ensure the `salsadigitalauorg/scaffold-testing` runs as you execute `composer install` or `composer update`, add the following to the `post-install-cmd` and `post-update-cmd` sections of your project' composer.json:

```
"scripts": {
   "install-features": "Salsadigitalauorg\\ScaffoldTesting\\Installer\\Installer::features",
   "post-install-cmd": [
        "Salsadigitalauorg\\ScaffoldTesting\\Installer\\Installer::features"
    ],
   "post-update-cmd": [
        "Salsadigitalauorg\\ScaffoldTesting\\Installer\\Installer::features"
    ]
}
```

Alternatively, add `install-features` command only:

```
"scripts": {
   "install-features": "Salsadigitalauorg\\ScaffoldTesting\\Installer\\Installer::features",
}
```

To customize the tests or the installation path, you can modify the `extra` section in your project's `composer.json`:

```
"extra": {
  "scaffold-testing": {
    "target-dir": "tests/behat/",
    "files": {
        "homepage.feature": false,
        "login.feature": false,
        "search.feature": true,
        "contenttypes.feature": false
    },
    "override_feature_context": false,
    "override_feature": false,
  }
}
```

- `target-dir`: Specifies the base directory for test files (default: "tests/behat/").
- `files`: An object where keys are feature file names and values are boolean flags indicating whether to override existing files. When `files` key is omited, the existing files will be left untouched and missing files will be installed.
- `override_feature_context`: Whether to overwrite the existing FeatureContext.php file (default: false).
- `override_feature`: Whether to overwrite the existing feature file (default: false).

If the `files` section is omitted, all available feature files will be installed only if they don't already exist in the target directory.

The installer will create the necessary subdirectories within the `target-dir`:

#### Contributing

[](#contributing)

Contributions to the **Scaffold Testing Library** are welcome! Please feel free to submit pull requests or create issues for any bugs you discover or enhancements you suggest.

#### License

[](#license)

This library is provided under the MIT License. See the LICENSE file for more information.

Breaking Changes in Version 0.4.2
=================================

[](#breaking-changes-in-version-042)

Important: Trait-based Step Definitions
---------------------------------------

[](#important-trait-based-step-definitions)

Starting from version 0.4.2, we've moved to a trait-based approach for step definitions. This is a breaking change that requires manual intervention for existing projects.

### For Existing Projects

[](#for-existing-projects)

If you're upgrading from a previous version, you'll need to:

1. Remove the old step definitions from your `FeatureContext.php`
2. Add the trait to your `FeatureContext.php`:

```
use Salsadigitalauorg\ScaffoldTesting\Traits\ScaffoldTestingTrait;

class FeatureContext implements Context
{
    use ScaffoldTestingTrait;

    // Your custom step definitions...
}
```

### For New Projects

[](#for-new-projects)

The installer will automatically set up your `FeatureContext.php` with the trait. You can add your custom step definitions alongside the trait.

### Combining Custom Steps

[](#combining-custom-steps)

You can add your own custom step definitions alongside the trait:

```
class FeatureContext implements Context
{
    use ScaffoldTestingTrait;

    /**
     * @Given I have my custom step
     */
    public function iHaveMyCustomStep(): void
    {
        // Your custom step implementation
    }
}
```

Requirements
------------

[](#requirements)

- PHP 8.3 or higher
- Composer 2.x
- Behat 3.13 or higher
- PHPUnit 9.6.13 or higher (compatible with Drupal core)

Dependencies
------------

[](#dependencies)

This package requires the following dependencies which will be installed automatically:

```
{
    "require": {
        "behat/behat": "^3.13",
        "composer/composer": "^2.6",
        "symfony/process": "^6.0|^7.0",
        "phpunit/phpunit": "^9.6.13"
    }
}
```

###  Health Score

38

—

LowBetter than 85% of packages

Maintenance60

Regular maintenance activity

Popularity23

Limited adoption so far

Community12

Small or concentrated contributor base

Maturity49

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 98% 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 ~27 days

Recently: every ~33 days

Total

6

Last Release

482d ago

PHP version history (2 changes)0.2PHP &gt;=8.2

0.4.2PHP &gt;=8.3

### Community

Maintainers

![](https://www.gravatar.com/avatar/7705d0a3f1b688b13e8a8fdde40407277b85218bce3e378b8edf5c4d27f067b9?d=identicon)[ivangrynenko](/maintainers/ivangrynenko)

![](https://www.gravatar.com/avatar/9a320969efb03e56f96b4c05e9eb5c574decf76deb9b34c74983cd9675104529?d=identicon)[salsadigital](/maintainers/salsadigital)

---

Top Contributors

[![ivangrynenko](https://avatars.githubusercontent.com/u/2966198?v=4)](https://github.com/ivangrynenko "ivangrynenko (49 commits)")[![dependabot[bot]](https://avatars.githubusercontent.com/in/29110?v=4)](https://github.com/dependabot[bot] "dependabot[bot] (1 commits)")

### Embed Badge

![Health badge](/badges/salsadigitalauorg-scaffold-testing/health.svg)

```
[![Health](https://phpackages.com/badges/salsadigitalauorg-scaffold-testing/health.svg)](https://phpackages.com/packages/salsadigitalauorg-scaffold-testing)
```

###  Alternatives

[brianium/paratest

Parallel testing for PHP

2.5k118.8M754](/packages/brianium-paratest)[orchestra/testbench

Laravel Testing Helper for Packages Development

2.2k39.1M32.1k](/packages/orchestra-testbench)[drevops/behat-steps

Collection of steps for Behat

25381.7k3](/packages/drevops-behat-steps)[ezsystems/behatbundle

Behat bundle for help testing eZ Bundles and projects

44857.4k17](/packages/ezsystems-behatbundle)[friends-of-behat/test-context

Provides reusable context that helps in testing Behat extensions.

1722.0k12](/packages/friends-of-behat-test-context)[webmozarts/strict-phpunit

Enables type-safe comparisons of objects in PHPUnit

31252.7k5](/packages/webmozarts-strict-phpunit)

PHPackages © 2026

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