Skip to content
Merged
Show file tree
Hide file tree
Changes from 4 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
20 changes: 20 additions & 0 deletions TESTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,26 @@ If a test fails, you can inspect the output.

Any errors should be corrected by making applicable code or test changes.

## Run PHP CodeSniffer

[PHP_CodeSniffer](https://github.com/squizlabs/PHP_CodeSniffer) checks that all code meets the [PSR-12 Coding Standards](https://www.php-fig.org/psr/psr-12/).

To run CodeSniffer on tests, enter the following command:

```bash
vendor/bin/phpcs
```

Any errors should be corrected by either:
- making applicable code changes
- (Experimental) running `vendor/bin/phpcbf` to automatically fix coding standards

Need to change the coding standard rules applied? Either:
- ignore a rule in the affected code, by adding `phpcs:ignore {rule}`, where {rule} is the given rule that failed in the above output.
- edit the [phpcs.tests.xml](phpcs.xml) file.

**Rules can be ignored with caution**, but it's essential that rules relating to coding style and inline code commenting / docblocks remain.

## Run PHP CodeSniffer for Tests

[PHP_CodeSniffer](https://github.com/squizlabs/PHP_CodeSniffer) checks that all test code meets the [PSR-12 Coding Standards](https://www.php-fig.org/psr/psr-12/).
Expand Down
10 changes: 8 additions & 2 deletions tests/ConvertKitAPITest.php
Original file line number Diff line number Diff line change
Expand Up @@ -109,7 +109,10 @@ public function testGetSequenceSubscriptions()
$this->assertIsArray($result['subscriptions']);

// Assert sort order is ascending.
$this->assertGreaterThan($result['subscriptions'][0]->created_at, $result['subscriptions'][1]->created_at);
$this->assertGreaterThanOrEqual(
$result['subscriptions'][0]->created_at,
$result['subscriptions'][1]->created_at
);
}

/**
Expand All @@ -134,7 +137,10 @@ public function testGetSequenceSubscriptionsWithDescSortOrder()
$this->assertIsArray($result['subscriptions']);

// Assert sort order.
$this->assertLessThan($result['subscriptions'][0]->created_at, $result['subscriptions'][1]->created_at);
$this->assertLessThanOrEqual(
$result['subscriptions'][0]->created_at,
$result['subscriptions'][1]->created_at
);
}

/**
Expand Down