Download the PHP package settleup/pest-plugin-visualizations without Composer
On this page you can find all versions of the php package settleup/pest-plugin-visualizations. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Informations about the package pest-plugin-visualizations
A Pest plugin for testing SettleUp Visualizations — expressive, chainable assertions for DataGrids, Charts, and Metrics.
Installation
Usage
The plugin exposes three namespaced functions — dataGrid(), chart(), and metric() — that each return a fluent tester. All assertion methods are chainable and return the tester instance.
DataGrid
Schema assertions
| Method | Description |
|---|---|
assertHasColumn(string $field) |
Assert a column with the given field name exists |
assertMissingColumn(string $field) |
Assert no column with the given field name exists |
assertColumnCount(int $count) |
Assert the total number of columns |
assertColumnIsSortable(string $field) |
Assert the column is sortable |
assertColumnIsNotSortable(string $field) |
Assert the column is not sortable |
assertColumnIsFilterable(string $field) |
Assert the column is filterable |
assertColumnIsNotFilterable(string $field) |
Assert the column is not filterable |
assertColumnIsVisible(string $field) |
Assert the column is visible (not hidden) |
assertColumnIsHidden(string $field) |
Assert the column is hidden |
assertColumnIsRowKey(string $field) |
Assert the column is marked as the row key |
assertHasFloatingFilter(string $field) |
Assert a floating filter with the given field name exists |
assertMissingFloatingFilter(string $field) |
Assert no floating filter with the given field name exists |
Data assertions
Use usingFilterSets() and usingSorts() to configure the query context before asserting on results. Each call replaces the previous context.
| Method | Description |
|---|---|
usingFilterSets(Closure $configure) |
Configure filter context for subsequent data assertions |
usingSorts(Closure $configure) |
Configure sort context for subsequent data assertions |
assertRowCount(int $expected) |
Assert the number of rows returned |
assertNoResults() |
Assert the query returns no rows |
assertRowMatches(array $expected) |
Assert at least one row matches all given key/value pairs |
assertRowMissing(array $expected) |
Assert no row matches all given key/value pairs |
Chart
Schema assertions
| Method | Description |
|---|---|
assertHasLabel(string $field) |
Assert the chart has a label with the given field name |
assertHasNoLabel() |
Assert the chart uses NullLabel (no label) |
assertHasDataset(string $field) |
Assert a dataset with the given field name exists |
assertMissingDataset(string $field) |
Assert no dataset with the given field name exists |
assertDatasetCount(int $count) |
Assert the total number of datasets |
assertHasFloatingFilter(string $field) |
Assert a floating filter with the given field name exists |
assertMissingFloatingFilter(string $field) |
Assert no floating filter with the given field name exists |
Data assertions
| Method | Description |
|---|---|
usingFilterSets(Closure $configure) |
Configure filter context for subsequent data assertions |
usingSorts(Closure $configure) |
Configure sort context for subsequent data assertions |
assertResultCount(int $count) |
Assert the number of result rows |
assertNoResults() |
Assert the query returns no results |
assertResultContains(array $expected) |
Assert at least one result row matches all given key/value pairs |
assertResultMissing(array $expected) |
Assert no result row matches all given key/value pairs |
Metric
Schema assertions
| Method | Description |
|---|---|
assertHasValue(string $field) |
Assert the metric's value has the given field name |
assertHasFloatingFilter(string $field) |
Assert a floating filter with the given field name exists |
assertMissingFloatingFilter(string $field) |
Assert no floating filter with the given field name exists |
Data assertions
| Method | Description |
|---|---|
usingFilterSets(Closure $configure) |
Configure filter context for subsequent data assertions |
assertAggregateEquals(mixed $expected) |
Assert the aggregate value equals the expected value |
assertAggregateNull() |
Assert the aggregate value is null |
Testing
License
The MIT License (MIT). Please see License File for more information.
All versions of pest-plugin-visualizations with dependencies
pestphp/pest Version ^4.0
pestphp/pest-plugin Version ^4.0
settleup/visualizations Version ^1.1.0