<!-- **Project:** - [ ] Add an `examples/` top level directory (raw, Laravel, etc.). - [ ] Write readme and documentation (why, prior art, callable assertions for flexibility, assertions list, examples folder link). - [ ] Create a logo using Tailwind bg gradient (rainbow) of `<AssertableHtml/>` in `art/` folder. **General:** - [ ] Property hooks for root/document/selector (breaks Pint). - [x] Make assertions fluent. - [ ] PHPStan types. - [ ] Rename `toElement()` to `toAssertableElement()`. - [ ] Throw exception if Document or Element are XMLDocument/XMLElement instances. - [ ] Allow constructor selector to be empty, which targets the current document/element instead? Update root element marcher to handle this specific scenario??? **Elements:** - [x] Add a `when()` helper to assertable elements, as it's handy for conditional testing. - [ ] Element for `<head>` that has `assertPageTitle()`/`assertFavicon()`/`assertMetaDescription()` etc. Use built in `title` and `head` properties on document, so these can be asserted anywhere. - [ ] Add assertable elements for `input`, `select`, `textarea` and a few other common elements. - [x] Add a `bool match = true` parameter to AssetableHtml, which should be used to skip auto matching root element in the case of using methods like `with()`, where the element is matched up front to determine the right class. It's the simplest and least messy solution??? Explore an `upgrade()` method or using a lazy ghost object. - [ ] Do we need a generic assertion message building class. e.g. `Message::element($el, $msg)` = `The element [foo.bar]`, `Message::elementAttribute($el, $attr, $msg)`. - [ ] Tidy up assertion messages (some include value [value] at the end, others don't). - [x] Abstract `$normaliseWhitespace` ternaries into a method. **Components:** - [ ] `->element(selector, class, ?callable callback)` method that allows the user to create their own custom assertable element classes. Similar to what Dusk does. Needs an `assertValid()` method that's always called to ensure the right element was selected. **Assertions:** - [x] Need callable versions of each assertion type, so if anyone is ever stuck they can easily do a custom assertion. **Class Assertions:** - [x] `assertClassPresent()`/`assertClassMissing()` proxy to `assertAttributePresent()`/`assertAttributeMissing()`. `assertXXXExists()/assertXXXDoesntExist()` might be better names. - [x] `assertClassContains()` should maybe take an array|string of classes? Depends on underlying method. Maybe need to use `array_any/all()` for `assertClassContainsAll/Any()` methods (all useful, left any for now, since overlaps with contains). **Attribute Assertions:** - [x] Attribute/Data/Aria Attribute (can proxy latter through 'data-'/'aria-' . $attribute type thing), see $message. - [x] `assertAttributes(callable)`/`assertAttribute(attribute, callable)`. - [x] `assertHasAttribute(attribute)`, `assertDoesntHaveAttribute(attribute)` OR present/missing. - [x] `assertAttributeContains(attribute, value)`, `assertAttributeDoesntContain(attribute, value)`. - [x] `assertAttributeEquals(attribute, value)`, `assertAttributeDoesntEqual(attribute, value)`. **Presence Assertions:** - [x] `assertPresent(selector)`/`assertMissing(selector)` aliases for `assertMatchesSelector()`??? - [x] `assertEmpty()`/`assertNotEmpty()` using `:empty` CSS selector (tricky, and not that useful). - [x] `assertCountElements(expected, selector)` for counting sub elements. **Count Assertions:** - [x] `assertElementsCount()`/LT/GT/LTE/GTE. **Input Assertions:** - [ ] `assertDateTimeEquals(new DateTime)`, `assertOptionSelected/Unselected()`, `assertOptions(options)`, `assertOptGroupOptions(optgroup, options)`, `assertInput([type => text, value => foobar, checked => false, data-plop => foo])`, `assertSelect()` - [ ] `assertAttributesEqualsArray(attr, [foo => bar, _text => text content])` - [ ] `assertRequired()`/`assertNotRequired()` (should it be checked/not checked, selected/not selected)? **Laravel Integration:** - [ ] Add an `AssertsHtml` trait for generic use in PHPUnit or Pest. - [ ] Laravel Service Provider that macros/mixin onto `TestResponse` methods `assertHtmlHead()`, `assertHtmlBody()` and `assertHtml()`. Use a mixin macro class. Mixin can use the trait above. - [ ] Orchestra TestBench Laravel integration tests. **Selector:** - [ ] Explore replacing `RootElementMatcher` with a `Selector` string class instead. I have some working code of this already knocking around. **Tests:** - [ ] Need an integration test with all elements where everything is asserted using all the features. Also serves as an example. -->