Commit Graph

17 Commits

Author SHA1 Message Date
John Blackbourn 814aa7149f Build/Test Tools: Remove the dependency on a globally installed Grunt.
The existing `"grunt": "grunt"` script in `package.json` allows for the use of `npm run grunt ...` which uses the local `grunt` binary in the project's `node_modules`.

Fixes #47380


git-svn-id: https://develop.svn.wordpress.org/trunk@45445 602fd350-edb4-49c9-b593-d223f7449a82
2019-05-26 19:34:24 +00:00
Gary Pendergast a75d153eee Coding Standards: Upgrade WPCS to 1.0.0
WPCS 1.0.0 includes a bunch of new auto-fixers, which drops the number of coding standards issues across WordPress significantly. Prior to running the auto-fixers, there were 15,312 issues detected. With this commit, we now drop to 4,769 issues.

This change includes three notable additions:
- Multiline function calls must now put each parameter on a new line.
- Auto-formatting files is now part of the `grunt precommit` script. 
- Auto-fixable coding standards issues will now cause Travis failures.

Fixes #44600.



git-svn-id: https://develop.svn.wordpress.org/trunk@43571 602fd350-edb4-49c9-b593-d223f7449a82
2018-08-17 01:50:26 +00:00
Gary Pendergast 8f95800d52 Code is Poetry.
WordPress' code just... wasn't.
This is now dealt with.

Props jrf, pento, netweb, GaryJ, jdgrimes, westonruter, Greg Sherwood from PHPCS, and everyone who's ever contributed to WPCS and PHPCS.
Fixes #41057.



git-svn-id: https://develop.svn.wordpress.org/trunk@42343 602fd350-edb4-49c9-b593-d223f7449a82
2017-11-30 23:09:33 +00:00
John Blackbourn f017338460 Build/Test Tools: Don't trigger a skipped test when the built version of `wp-embed.min.js` isn't present.
The grunt command assertion prior to the check for the existence of the file is enough to safeguard this test.

See #34698, #40533


git-svn-id: https://develop.svn.wordpress.org/trunk@40526 602fd350-edb4-49c9-b593-d223f7449a82
2017-04-22 20:17:49 +00:00
Sergey Biryukov 97a4d6c16d Build/Test Tools: Add `assertNotFalse()` method to `WP_UnitTestCase` and use it where appropriate.
Props peterwilsoncc.
Fixes #39219.

git-svn-id: https://develop.svn.wordpress.org/trunk@39919 602fd350-edb4-49c9-b593-d223f7449a82
2017-01-17 03:39:36 +00:00
Pascal Birchler afdf1c9ec1 Embeds: Adjust the iframe title attribute for improved accessibility.
Changes the title attribute from `Embedded WordPress Post` to `"Post name" — site title`.

Props ramiy.
Fixes #35804.

git-svn-id: https://develop.svn.wordpress.org/trunk@36873 602fd350-edb4-49c9-b593-d223f7449a82
2016-03-07 09:59:02 +00:00
Drew Jaynes 138b55c16e Embeds: Update embed template paths and messages in tests, missed in [36693].
Props ocean90
See #34561.


git-svn-id: https://develop.svn.wordpress.org/trunk@36694 602fd350-edb4-49c9-b593-d223f7449a82
2016-02-24 21:20:41 +00:00
Andrew Nacin 12b1cc4410 Embeds: Enforce, via unit tests, the no-ampersand rule for wp-embed.js.
fixes #34698.


git-svn-id: https://develop.svn.wordpress.org/trunk@35762 602fd350-edb4-49c9-b593-d223f7449a82
2015-12-04 05:45:29 +00:00
Sergey Biryukov fbd0b570fc Embeds: In `get_post_embed_html()`, move the optional `$post` argument after the required `$width` and `$height`.
Props swissspidy.
Fixes #34523.

git-svn-id: https://develop.svn.wordpress.org/trunk@35472 602fd350-edb4-49c9-b593-d223f7449a82
2015-10-31 15:50:23 +00:00
Gary Pendergast 4832d8d933 Embeds: Who put this REST API infrastructure in my WordPress?
Well, while it's here, we probably should make use of it. The oEmbed endpoint now uses the REST API infrastructure, instead of providing its own.

Props swissspidy.

Fixes #34207.



git-svn-id: https://develop.svn.wordpress.org/trunk@35436 602fd350-edb4-49c9-b593-d223f7449a82
2015-10-29 22:50:13 +00:00
Sergey Biryukov 391b67356a Embeds: Include post name in "Continue reading" links to provide a readable link for screenreaders.
Props swissspidy.
Fixes #34481.

git-svn-id: https://develop.svn.wordpress.org/trunk@35432 602fd350-edb4-49c9-b593-d223f7449a82
2015-10-29 13:20:04 +00:00
John Blackbourn 9fbff7f63a Add `is_embed()` to `WP_UnitTestCase::assertQueryTrue()` and update the relevant embed tests.
See #32522


git-svn-id: https://develop.svn.wordpress.org/trunk@35257 602fd350-edb4-49c9-b593-d223f7449a82
2015-10-18 04:50:15 +00:00
John Blackbourn ab43e7362d Correct a test after r35253.
See #34272


git-svn-id: https://develop.svn.wordpress.org/trunk@35255 602fd350-edb4-49c9-b593-d223f7449a82
2015-10-18 00:55:16 +00:00
Scott Taylor b757b37551 Unit Tests: after [35225], make `factory` a method/getter on `WP_UnitTestCase` and add magic methods for BC for every plugin that is extending `WP_UnitTestCase` and accessing the `$factory` instance prop.
Props nerrad, wonderboymusic.
See #30017, #33968.



git-svn-id: https://develop.svn.wordpress.org/trunk@35242 602fd350-edb4-49c9-b593-d223f7449a82
2015-10-17 18:02:16 +00:00
Sergey Biryukov 9b591d6b09 Embeds: Rename files, functions, and hooks added in [34903] to make it more clear what is oEmbed-specific and what isn't.
See https://core.trac.wordpress.org/ticket/34272#comment:7 for full list of renamed functions and hooks.

Props swissspidy.
Fixes #34272.

git-svn-id: https://develop.svn.wordpress.org/trunk@35235 602fd350-edb4-49c9-b593-d223f7449a82
2015-10-17 01:20:19 +00:00
Scott Taylor e70ebea219 Unit Tests: one `$factory` to rule them all, and it shall be `static`.
Using more than one instance of `WP_UnitTest_Factory` causes all kinds of craziness, due to out-of-sync internal generator sequences. Since we want to use `setUpBeforeClass`, we were creating ad hoc instances. To avoid that, we were injecting one `static` instance via Dependency Injection in `wpSetUpBeforeClass`. All tests should really use the `static` instance, so we will remove the instance prop `$factory`.

Replace `$this->factory` with `self::$factory` over 2000 times.
Rewrite all of the tests that were hard-coding dynamic values. 

#YOLOFriday



git-svn-id: https://develop.svn.wordpress.org/trunk@35225 602fd350-edb4-49c9-b593-d223f7449a82
2015-10-16 21:04:12 +00:00
Gary Pendergast 43bd3d46c9 Embeds: Add oEmbed provider support.
For the past 6 years, WordPress has operated as an oEmbed consumer, allowing users to easily embed content from other sites. By adding oEmbed provider support, this allows any oEmbed consumer to embed posts from WordPress sites.

In addition to creating an oEmbed provider, WordPress' oEmbed consumer code has been enhanced to work with any site that provides oEmbed data (as long as it matches some strict security rules), and provides a preview from within the post editor.

For security, embeds appear within a sandboxed iframe - the iframe content is a template that can be styled or replaced entirely by the theme on the provider site.

Props swissspidy, pento, melchoyce, netweb, pfefferle, johnbillion, extendwings, davidbinda, danielbachhuber, SergeyBiryukov, afercia

Fixes #32522.



git-svn-id: https://develop.svn.wordpress.org/trunk@34903 602fd350-edb4-49c9-b593-d223f7449a82
2015-10-07 10:35:18 +00:00