We are setting xmlns attributes at the root element but PHP would
still attach redundant ones to the DOM elements created with `createElementNS`.
That was because PHP reconciles namespace attributes when appending elements to DOM
but since we previously only attached the elements after all children were attached,
the reconciliation algorithm was not able to see the root element’s attributes.
To fix this, let’s attach each element to its parent immediately after it is created.
There is a lot of redundancy. Let’s not repeat ourselves.
Unfortunately, since we do not install PHPUnit as a project dependency on CI,
it does not use the composer’s PSR-4 autoloader and the tests are unable to find
the `BaseFormatTest` class.
Until we resolve that, let’s load the class explicitly.
the date handling
The deal posting date logic was wrong, and leaded to warnings and
notice. Now, only the feed with the deal sorted by date contains date
(the feed sorted by hottest deal does not contain a date anymore,
because there are no deal date in this case).
We cannot yet switch to namespaces for RSS-Bridge itself but for tests we are not limited by BC.
It does not actually do anything since PHPUnit will search for the test files without the help of the autoloader but it still makes the directory cleaner.
* [AtomFormat]: Generate using DomDocument
This will escape the HTML content for us as needed.
* [MrssFormat]: Generate using DomDocument
This will escape the HTML content for us as needed.
With UTF-8 byte-order mark in the file, the `ListActionTest::testOutput`
would fail after converting tests to PSR-4 namespaces:
invalid JSON output: Syntax error
Failed asserting that null is not null.
This is because ListAction::execute tries to create the bridge objects
and, when the files containing the bridge classes are not loaded yet,
the autoloader starts including them. Since this happens after output
buffering has begun, any text in the PHP file before the `<?php` tag
such as the BOM will end up in the buffer to be parsed by `json_decode`.
Previously, it worked by chance thanks to some other test including the file
before `ListActionTest`. With the restructuring, `Actions\ListActionTest`
will run sooner and become responsible for triggering the autoloader.
To prevent this in the future, I also disallowed BOM in the coding style.
The /all url now actually points to a specific item.
I think we want the frontpage for this.
Fixes:
Fatal error: Uncaught Error: Call to a member function find() on null in NotAlwaysBridge.php:37
* [GitlabIssueBridge] new bridge
This tracks issue comments on arbitrary gitlab projects.
* [GitlabIssueBridge] Prepare for Merge Request support + fixes
- Proper UIDs
- Default bridge name fixed
- Fix cache identifiers
- Add TODOs
* [GitlabIssueBridge] creation timestamp preferred
And prefer original author over editor.
* [GitlabIssueBridge] Do not add date to item title
Prettier without it.
* [GitlabIssueBridge] Support Merge Requests
This bridge can now generate feeds for Merge Requests.
* [GitlabIssueBridge] typo
* [GitlabIssueBridge] Fix Img src attr in comments
* [GitlabIssueBridge] Fix function call
* [GitlabIssueBridge] Fix test
Use gitlab.com if no h parameter was given.
Fixes a phpunit test.
* [GitlabIssueBridge] linting
* [GitlabIssueBridge] Add MR support to description
* [GitlabIssueBridge] Move function collectData
* [GitlabIssueBridge] rm single-use class constants
* [GitlabIssueBridge] Remove manual caching
Just depend on rss-bridges built-in caching.
Do not add all images of the image gallery, but only the preselected one.
Often, the same gallery is used multiple times with different preselected
images. The previous implementation always added all images of the
gallery, cluttering the article. This patch only adds the preselected one.
The no-js link wrapping around the gallery leads to a 403 Forbidden
page, so linking that doesn't work to really support galleries.