初始版本
This commit is contained in:
56
tests/Feature/MarkdownTest.php
Normal file
56
tests/Feature/MarkdownTest.php
Normal file
@ -0,0 +1,56 @@
|
||||
<?php
|
||||
|
||||
namespace DingNotice\Tests\Feature;
|
||||
|
||||
use DingNotice\Tests\TestCase;
|
||||
|
||||
|
||||
class MarkDownTest extends TestCase
|
||||
{
|
||||
protected $title = "杭州天气";
|
||||
protected $markdown = "#### 杭州天气 \n ".
|
||||
"> 9度,@1825718XXXX 西北风1级,空气良89,相对温度73%\n\n ".
|
||||
"> \n".
|
||||
"> ###### 10点20分发布 [天气](http://www.thinkpage.cn/) ";
|
||||
|
||||
public function __construct($name = null, array $data = [], $dataName = '')
|
||||
{
|
||||
parent::__construct($name, $data, $dataName);
|
||||
$this->setUp();
|
||||
}
|
||||
|
||||
/**
|
||||
* available content to set
|
||||
* @param $content
|
||||
* @return bool
|
||||
* @author wangju 2019-05-17 21:50
|
||||
*/
|
||||
protected function matchContent($content)
|
||||
{
|
||||
return $content['title'] && $content['text'];
|
||||
}
|
||||
|
||||
/**
|
||||
* A basic test example.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function testPushMarkdownMessage()
|
||||
{
|
||||
$result =$this->ding->markdown($this->title,$this->markdown);
|
||||
$this->assertSame([
|
||||
'errmsg' => 'ok',
|
||||
'errcode' => 0
|
||||
],$result);
|
||||
}
|
||||
|
||||
public function testPushMarkdownMessageAtAllUser(){
|
||||
$result =$this->ding
|
||||
->at([],true)
|
||||
->markdown($this->title,$this->markdown);
|
||||
$this->assertSame([
|
||||
'errmsg' => 'ok',
|
||||
'errcode' => 0
|
||||
],$result);
|
||||
}
|
||||
}
|
Reference in New Issue
Block a user