Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Idea to introduce a new trait that provides assertions for feature tests #243

Open
jkswoods opened this issue Aug 18, 2021 · 1 comment
Open

Comments

@jkswoods
Copy link

jkswoods commented Aug 18, 2021

Hey, so I've been writing some feature tests to validate the functionality I've built with the help of this package is working correctly.

While doing so, I noticed the tests often got a bit clunky and could be simplified a bit with the help of some new assertions - I ended up creating a trait called DynamoDbTestAssertions that provides the following methods:

public static function assertDynamoDbHasTable(string $table);
public static function assertDynamoDbMissingTable(string $table);
public static function assertDynamoDbHasItem(string $table, string $key, $keyValue);
public static function assertDynamoDbMissingItem(string $table, string $key, $keyValue);
public static function assertDynamoDbItemEquals(string $table, string $key, $keyValue, $expected);
public static function assertDynamoDbItemNotEquals(string $table, string $key, $keyValue, $expected);

My tests are so much easier to read and write because of this...

What do you think?

@JackPriceBurns
Copy link
Collaborator

Looks very helpful, if you're interested in raising a PR, I'm sure others would also benefit from this

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants