Skip to content

Conversation

uzulla
Copy link
Contributor

@uzulla uzulla commented Oct 4, 2025

Hi, I updated the fixtures for PHPUnit. All tests (except Instagram and fb) are pass.

In DocumentTest::testSelectors is watch the Wired article, but the URL currently redirect to the top page. So, this may mean the test case isn’t good.

(I’m planning to open a aanother PR(fix issue with PHPStan), and first wanted to get the tests green.)

tests result.

$ php -v
PHP 8.4.7 (cli) (built: May  6 2025 12:31:58) (NTS)
Copyright (c) The PHP Group
Built by Homebrew
Zend Engine v4.4.7, Copyright (c) Zend Technologies
    with Zend OPcache v8.4.7, Copyright (c), by Zend Technologies

$ php -a
php > echo E_ALL & ~E_DEPRECATED;
22527

# 22527 is to ignore Deprecated error.
$ php -d error_reporting=22527 vendor/bin/phpunit
PHPUnit 9.6.29 by Sebastian Bergmann and contributors.

Runtime:       PHP 8.4.7
Configuration: /Users/uzulla/dev/PHpEmbed-Embed/phpunit.xml.dist

.......................................................S......S.. 65 / 72 ( 90%)
.......                                                           72 / 72 (100%)

Time: 00:09.694, Memory: 36.00 MB

There were 2 skipped tests:

1) Embed\Tests\PagesTest::testInstagram
Environment variable `INSTAGRAM_TOKEN` must be provided to test instagram. See https://developers.facebook.com/docs/instagram/oembed/

/Users/uzulla/dev/PHpEmbed-Embed/tests/PagesTest.php:124

2) Embed\Tests\PagesTest::testFacebook
Environment variable `FACEBOOK_TOKEN` must be provided to test facebook. See https://developers.facebook.com/docs/plugins/oembed

/Users/uzulla/dev/PHpEmbed-Embed/tests/PagesTest.php:165

OK, but incomplete, skipped, or risky tests!
Tests: 72, Assertions: 98, Skipped: 2.

tiny update in Document::__construct

https://github.com/uzulla/PHpEmbed-Embed/pull/2/checks?sha=5712cf371df403f981af3bd2687b2652cef7b278

1) Embed\Tests\PagesTest::testPages with data set #10 ('http://www.hookem.com/story/t...ation/')
mb_encoding_aliases(): Unknown encoding ""

/home/runner/work/PHpEmbed-Embed/PHpEmbed-Embed/src/Document.php:49
/home/runner/work/PHpEmbed-Embed/PHpEmbed-Embed/src/Extractor.php:100
/home/runner/work/PHpEmbed-Embed/PHpEmbed-Embed/src/ExtractorFactory.php:63
/home/runner/work/PHpEmbed-Embed/PHpEmbed-Embed/src/Embed.php:69
/home/runner/work/PHpEmbed-Embed/PHpEmbed-Embed/src/Embed.php:26
/home/runner/work/PHpEmbed-Embed/PHpEmbed-Embed/tests/PagesTestCase.php:60
/home/runner/work/PHpEmbed-Embed/PHpEmbed-Embed/tests/PagesTest.php:65
phpvfscomposer:///home/runner/work/PHpEmbed-Embed/PHpEmbed-Embed/vendor/phpunit/phpunit/phpunit:106

because PHP version differences.

  • PHP 7.4: mb_encoding_aliases() returns false for invalid encoding and throws Warning for empty string
  • PHP 8.0+: mb_encoding_aliases() throws ValueError for invalid/empty encoding

ref: #552

Deps detail.

$ composer show
brick/varexporter                  0.3.8  A powerful alternative to var_export(), which can export closures and objects without __set_state()
composer/ca-bundle                 1.5.8  Lets you find a path to the system CA bundle, and includes a fallback to the Mozilla CA bundle.
composer/pcre                      1.0.1  PCRE wrapping library that offers type-safe preg_* replacements.
composer/semver                    3.4.4  Semver library that offers utilities, version constraint parsing and validation.
composer/xdebug-handler            2.0.5  Restarts a process without Xdebug.
doctrine/annotations               1.14.4 Docblock Annotations Parser
doctrine/deprecations              1.1.5  A small layer on top of trigger_error(E_USER_DEPRECATED) or PSR-3 logging with options to disable all deprecations or selectively for packages.
doctrine/instantiator              2.0.0  A small, lightweight utility to instantiate objects in PHP without invoking their constructors
doctrine/lexer                     2.1.1  PHP Doctrine Lexer parser library that can be used in Top-Down, Recursive Descent Parsers.
friendsofphp/php-cs-fixer          2.19.3 A tool to automatically fix PHP code style
ml/iri                             1.1.4  IRI handling for PHP
ml/json-ld                         1.2.1  JSON-LD Processor for PHP
myclabs/deep-copy                  1.13.4 Create deep copies (clones) of your objects
nikic/php-parser                   4.19.4 A PHP parser written in PHP
nyholm/psr7                        1.8.2  A fast PHP7 implementation of PSR-7
oscarotero/html-parser             0.1.8  Parse html strings to DOMDocument
oscarotero/php-cs-fixer-config     1.0.2  My own custom php-cs-fixer config
phar-io/manifest                   2.0.4  Component for reading phar.io manifest information from a PHP Archive (PHAR)
phar-io/version                    3.2.1  Library for handling version information and constraints
php-cs-fixer/diff                  1.3.1  sebastian/diff v2 backport support for PHP5.6
phpunit/php-code-coverage          9.2.32 Library that provides collection, processing, and rendering functionality for PHP code coverage information.
phpunit/php-file-iterator          3.0.6  FilterIterator implementation that filters files based on a list of suffixes.
phpunit/php-invoker                3.1.1  Invoke callables with a timeout
phpunit/php-text-template          2.0.4  Simple template engine.
phpunit/php-timer                  5.0.3  Utility class for timing
phpunit/phpunit                    9.6.29 The PHP Unit Testing framework.
psr/cache                          3.0.0  Common interface for caching libraries
psr/container                      2.0.2  Common Container Interface (PHP FIG PSR-11)
psr/event-dispatcher               1.0.0  Standard interfaces for event handling.
psr/http-client                    1.0.3  Common interface for HTTP clients
psr/http-factory                   1.1.0  PSR-17: Common interfaces for PSR-7 HTTP message factories
psr/http-message                   2.0    Common interface for HTTP messages
psr/log                            2.0.0  Common interface for logging libraries
sebastian/cli-parser               1.0.2  Library for parsing CLI options
sebastian/code-unit                1.0.8  Collection of value objects that represent the PHP code units
sebastian/code-unit-reverse-lookup 2.0.3  Looks up which function or method a line of code belongs to
sebastian/comparator               4.0.9  Provides the functionality to compare PHP values for equality
sebastian/complexity               2.0.3  Library for calculating the complexity of PHP code units
sebastian/diff                     4.0.6  Diff implementation
sebastian/environment              5.1.5  Provides functionality to handle HHVM/PHP environments
sebastian/exporter                 4.0.8  Provides the functionality to export PHP variables for visualization
sebastian/global-state             5.0.8  Snapshotting of global state
sebastian/lines-of-code            1.0.4  Library for counting the lines of code in PHP source code
sebastian/object-enumerator        4.0.4  Traverses array structures and object graphs to enumerate all referenced objects
sebastian/object-reflector         2.0.4  Allows reflection of object attributes, including inherited and non-public ones
sebastian/recursion-context        4.0.6  Provides functionality to recursively process PHP variables
sebastian/resource-operations      3.0.4  Provides a list of PHP built-in functions that operate on resources
sebastian/type                     3.2.1  Collection of value objects that represent the types of the PHP type system
sebastian/version                  3.0.2  Library that helps with managing the version number of Git-hosted PHP projects
symfony/console                    5.4.47 Eases the creation of beautiful and testable command line interfaces
symfony/css-selector               5.4.45 Converts CSS selectors to XPath expressions
symfony/deprecation-contracts      3.6.0  A generic function and convention to trigger deprecation notices
symfony/event-dispatcher           5.4.45 Provides tools that allow your application components to communicate with each other by dispatching events and listening to them
symfony/event-dispatcher-contracts 3.6.0  Generic abstractions related to dispatching event
symfony/filesystem                 5.4.45 Provides basic utilities for the filesystem
symfony/finder                     5.4.45 Finds files and directories via an intuitive fluent interface
symfony/options-resolver           5.4.45 Provides an improved replacement for the array_replace PHP function
symfony/polyfill-ctype             1.33.0 Symfony polyfill for ctype functions
symfony/polyfill-intl-grapheme     1.33.0 Symfony polyfill for intl's grapheme_* functions
symfony/polyfill-intl-normalizer   1.33.0 Symfony polyfill for intl's Normalizer class and related functions
symfony/polyfill-mbstring          1.33.0 Symfony polyfill for the Mbstring extension
symfony/polyfill-php70             1.20.0 Symfony polyfill backporting some PHP 7.0+ features to lower PHP versions
symfony/polyfill-php72             1.31.0 Symfony polyfill backporting some PHP 7.2+ features to lower PHP versions
symfony/polyfill-php73             1.33.0 Symfony polyfill backporting some PHP 7.3+ features to lower PHP versions
symfony/polyfill-php80             1.33.0 Symfony polyfill backporting some PHP 8.0+ features to lower PHP versions
symfony/process                    5.4.47 Executes commands in sub-processes
symfony/service-contracts          3.6.0  Generic abstractions related to writing services
symfony/stopwatch                  5.4.45 Provides a way to profile code
symfony/string                     6.4.26 Provides an object-oriented API to strings and deals with bytes, UTF-8 code points and grapheme clusters in a unified way
theseer/tokenizer                  1.2.3  A small library for converting tokenized PHP source code into XML and potentially other formats

@oscarotero
Copy link
Collaborator

thank you. Can you update the actions used in the workflow? The test is failing because it's using a very old version.

@uzulla
Copy link
Contributor Author

uzulla commented Oct 5, 2025

Okey, I'll fix it.

@uzulla
Copy link
Contributor Author

uzulla commented Oct 5, 2025

@oscarotero oscarotero merged commit 86b2177 into php-embed:master Oct 5, 2025
6 checks passed
@oscarotero
Copy link
Collaborator

thank you!

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants