Skip to content

Conversation

@mpdude
Copy link

@mpdude mpdude commented Dec 9, 2022

Given the database has been created, at least the following now works for me™️:

$ USE_ORM=1 USE_FOUNDRY_BUNDLE=1 DATABASE_URL=mysqli://root@localhost/zenstruck_foundry__test php8.1 vendor/bin/behat
Feature: Behat support for Foundry

    As a developer writing tests with Behat, I want to be able to
    use Foundry for creating test data. Foundry needs to be configured,
    started and stopped accordingly. The database has to be reset before
    scenarios are run.

  Scenario: Creating two categories                   # tests/Behat/Foundry.feature:8
    When I create 2 categories                        # Zenstruck\Foundry\Tests\Behat\TestContext::createCategories()
    Then there should be 2 categories in the database # Zenstruck\Foundry\Tests\Behat\TestContext::assertCategoryCount()

  Scenario: Adding to the database                    # tests/Behat/Foundry.feature:12
    Given 1 category has been created                 # Zenstruck\Foundry\Tests\Behat\TestContext::createCategories()
    When I create 2 categories                        # Zenstruck\Foundry\Tests\Behat\TestContext::createCategories()
    Then there should be 3 categories in the database # Zenstruck\Foundry\Tests\Behat\TestContext::assertCategoryCount()

2 scenarios (2 passed)
5 steps (5 passed)
0m11.39s (35.34Mb)

@mpdude mpdude force-pushed the behat branch 2 times, most recently from ca1cfdb to ce0aa77 Compare December 9, 2022 22:19
@kbond kbond merged commit 92cecf7 into kbond:behat Dec 16, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants