Skip to content

Commit

Permalink
add test
Browse files Browse the repository at this point in the history
  • Loading branch information
YuzuruS committed Nov 22, 2016
1 parent 5b20adb commit a4f54bd
Show file tree
Hide file tree
Showing 5 changed files with 385 additions and 312 deletions.
2 changes: 2 additions & 0 deletions .coveralls.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
repo_token: REPO_TOKEN
coverage_clover: build/logs/clover.xml
29 changes: 29 additions & 0 deletions phpunit.xml.dist
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
<?xml version="1.0" encoding="UTF-8"?>

<phpunit backupGlobals="false"
backupStaticAttributes="false"
colors="true"
convertErrorsToExceptions="true"
convertNoticesToExceptions="true"
convertWarningsToExceptions="true"
processIsolation="false"
stopOnFailure="false"
syntaxCheck="false"
>

<testsuites>
<testsuite name="\YuzuruS\Wordpress\Post Test Suite">
<directory>./tests/</directory>
</testsuite>
</testsuites>

<filter>
<whitelist addUncoveredFilesFromWhitelist="true">
<directory suffix=".php">./src</directory>
</whitelist>
</filter>
<logging>
<!-- and this is where your report will be written -->
<log type="coverage-clover" target="build/logs/clover.xml"/>
</logging>
</phpunit>
20 changes: 10 additions & 10 deletions sample/usecase.php
Original file line number Diff line number Diff line change
Expand Up @@ -6,16 +6,16 @@
$wp = new Post(getenv(WP_USERNAME), getenv(WP_PASSWD), getenv(WP_ENDPOINT));

$res = $wp->makeCategories([
['name' => 'かて1', 'slug' => 'cate1'],
['name' => 'かて2', 'slug' => 'cate2'],
['name' => 'かて1', 'slug' => 'cate1'],
['name' => 'かて2', 'slug' => 'cate2'],
]);

$wp
->setTitle('たいとる')
->setDescription('本文')
->setKeywords(['key1','key2'])
->setCategories(['かて1','かて2'])
->setDate('2016-11-11')
->setWpSlug('entry')
->setThumbnail('https://www.pakutaso.com/shared/img/thumb/SAYA160312500I9A3721_TP_V.jpg')
->post();
->setTitle('たいとる')
->setDescription('本文')
->setKeywords(['key1','key2'])
->setCategories(['かて1','かて2'])
->setDate('2016-11-11')
->setWpSlug('entry')
->setThumbnail('https://www.pakutaso.com/shared/img/thumb/SAYA160312500I9A3721_TP_V.jpg')
->post();
Loading

0 comments on commit a4f54bd

Please sign in to comment.