test: test that bibtexbrowser.php still works well in Wordpress plugin wp-publications
This commit is contained in:
+31
@@ -1,5 +1,9 @@
|
||||
language: php
|
||||
|
||||
services:
|
||||
# wp-publications is a Wordpress plugin, wordpress requires mysql
|
||||
- mysql
|
||||
|
||||
php:
|
||||
- '5.6'
|
||||
- '7.0'
|
||||
@@ -10,4 +14,31 @@ script:
|
||||
- curl -L -o gakowiki-syntax.php https://www.monperrus.net/martin/gakowiki-syntax.php.txt
|
||||
- phpunit bibtexbrowser-test.php
|
||||
|
||||
# now testing this version of bibtexbrowser with wp-publications
|
||||
# Installing WP-CLI
|
||||
- curl -O https://raw.githubusercontent.com/wp-cli/builds/gh-pages/phar/wp-cli.phar
|
||||
- chmod 755 wp-cli.phar
|
||||
- WPCLI=/tmp/wp
|
||||
- mv wp-cli.phar $WPCLI
|
||||
# Installing wordpress with wp-cli
|
||||
- $WPCLI core download
|
||||
- mysql -u travis -e "CREATE DATABASE IF NOT EXISTS wp"
|
||||
- $WPCLI config create --dbname=wp --dbuser=travis
|
||||
- $WPCLI core install --url=http://bibtexbrowser.com --title="bibtexbrowser wordpress" --admin_user=root --admin_email=martin.monperrus@gnieh.org
|
||||
# installing wp-cli/restful, which is required to render shortcodes with wp-cli
|
||||
- $WPCLI package install wp-cli/restful
|
||||
- $WPCLI core version
|
||||
# installing plugin wp-publications
|
||||
- $WPCLI plugin install wp-publications --activate
|
||||
# there is no need to create a post, because one activation task of wp-publications is to create a fake post
|
||||
#- $WPCLI post create --post_title=test --post_content='[wp-publications bib="sample.bib" all=true]'
|
||||
- $WPCLI rest post list --slug=wp-publications-example --field=content | tee before.txt
|
||||
# do we still have the reference output? (useful for detecting changes in Wordpress or WP-CLI) (diff exits with 1 if there is a difference)
|
||||
- diff reference-output-wp-publications.txt before.txt
|
||||
# now we take the newer version and we render again
|
||||
- cp bibtexbrowser.php ./wp-content/plugins/wp-publications/
|
||||
- $WPCLI rest post list --slug=wp-publications-example --field=content | tee after.txt
|
||||
# just to be sure, is there a difference with the previous version?
|
||||
- diff before.txt after.txt
|
||||
|
||||
sudo: false
|
||||
|
||||
@@ -0,0 +1,13 @@
|
||||
array (
|
||||
'rendered' => '<p>[wp-publications bib=sample.bib all=1] gives:<br />
|
||||
|
||||
<span class="count">2 results</span>
|
||||
<table class="result">
|
||||
<tr><td colspan="2" class="sheader">2001</td></tr>
|
||||
<tr class="bibline"><td class="bibref"><a class="bibanchor" name="2"></a>[2]</td><td class="bibitem"><span itemscope="" itemtype="http://schema.org/ScholarlyArticle"><span class="bibtitle" itemprop="name">A book</span> (<span class="bibauthor"><span itemprop="author" itemtype="http://schema.org/Person">Jane Doe</span></span>), <span itemprop="datePublished">2001</span>.<span class="Z3988" title="ctx_ver=Z39.88-2004&rft_val_fmt=info%3Aofi%2Ffmt%3Akev%3Amtx%3Abook&rft.btitle=A+book&rft.genre=book&rft.pub=&rfr_id=info%3Asid%2F%3Asample.bib&rft.date=2001&rft.au=Jane+Doe"></span></span> <span class="bibmenu"><a class="biburl" title="doo2001" href="http://bibtexbrowser.com/?wp-publications=doo2001">[bibtex]</a></span></td></tr>
|
||||
<tr><td colspan="2" class="sheader">2000</td></tr>
|
||||
<tr class="bibline"><td class="bibref"><a class="bibanchor" name="1"></a>[1]</td><td class="bibitem"><span itemscope="" itemtype="http://schema.org/ScholarlyArticle"><span class="bibtitle" itemprop="name">An article</span> (<span class="bibauthor"><span itemprop="author" itemtype="http://schema.org/Person">Jane Doe</span></span>), <span class="bibbooktitle">In <span itemprop="isPartOf">The Wordpress Journal</span></span>, <span itemprop="datePublished">2000</span>.<span class="Z3988" title="ctx_ver=Z39.88-2004&rft_val_fmt=info%3Aofi%2Ffmt%3Akev%3Amtx%3Ajournal&rft.atitle=An+article&rft.jtitle=The+Wordpress+Journal&rft.volume=&rft.issue=&rft.pub=&rfr_id=info%3Asid%2F%3Asample.bib&rft.date=2000&rft.au=Jane+Doe"></span></span> <span class="bibmenu"><a class="biburl" title="doe2000" href="http://bibtexbrowser.com/?wp-publications=doe2000">[bibtex]</a></span></td></tr>
|
||||
</table></p>
|
||||
',
|
||||
'protected' => false,
|
||||
)
|
||||
Reference in New Issue
Block a user