Skip to content

Commit

Permalink
Merge 048ddb0 into 15a20cf
Browse files Browse the repository at this point in the history
  • Loading branch information
app2641 committed May 7, 2016
2 parents 15a20cf + 048ddb0 commit b2fd712
Show file tree
Hide file tree
Showing 88 changed files with 26 additions and 630 deletions.
10 changes: 0 additions & 10 deletions data/crawler/skeleton/PluginSkeleton.php
Original file line number Diff line number Diff line change
@@ -1,31 +1,26 @@
<?php


namespace Midnight\Crawler\Plugin;

use Midnight\Crawler\UriManager;
use Midnight\Utility\CrawlerException;

class ${name} extends AbstractPlugin implements PluginInterface
{

/**
* サイト名
*
* @var string
**/
protected $site_name = '';


/**
* RSSフィードのURL
*
* @var string
**/
protected $rss_url = '';



/**
* DOMElementからエントリのURLを返す
*
Expand All @@ -37,7 +32,6 @@ public function getEntryUrl ($entry)
return $this->getNodeValueByTagName($entry, 'link');
}


/**
* エントリの登録された日付を取得する
*
Expand All @@ -49,7 +43,6 @@ public function getEntryDate ($entry)
return $this->getDateByPubDate($entry);
}


/**
* エントリのタイトルを取得する
*
Expand All @@ -65,7 +58,6 @@ public function getEntryTitle ($html)
return $title_el->plaintext;
}


/**
* アイキャッチ画像のURLを取得する
*
Expand All @@ -83,7 +75,6 @@ public function getEyeCatchUrl ($html)
return $img_el->getAttribute('src');
}


/**
* 動画のURLを取得する
*
Expand All @@ -104,4 +95,3 @@ public function getMoviesUrl ($html)
return $movie_data;
}
}

4 changes: 0 additions & 4 deletions data/crawler/skeleton/PluginTestDataSkeleton.php
Original file line number Diff line number Diff line change
@@ -1,17 +1,14 @@
<?php


namespace Midnight\Crawler\Plugin\TestData;

class ${name}TestData extends AbstractTestData
{

/**
* @var string
**/
protected $rss_name = '${group}.xml';


/**
* @var array
**/
Expand All @@ -25,4 +22,3 @@ class ${name}TestData extends AbstractTestData
'${group}/error2.html'
);
}

5 changes: 0 additions & 5 deletions data/crawler/skeleton/PluginTestDataTestSkeleton.php
Original file line number Diff line number Diff line change
@@ -1,18 +1,15 @@
<?php


use Garnet\Container,
Midnight\Factory\CrawlerPluginTestDataFactory;

class ${name}TestDataTest extends PHPUnit_Framework_TestCase
{

/**
* @var ${name}TestDatt
**/
private $test_data;


/**
* @return void
**/
Expand All @@ -22,7 +19,6 @@ public function setUp ()
$this->test_data = $container->get('${name}');
}


/**
* @test
* @group ${group}-test
Expand All @@ -34,7 +30,6 @@ public function テスト用RSSデータのパスを取得する ()
$this->assertEquals(ROOT.'/data/fixtures/rss/${group}.xml', $rss_path);
}


/**
* @test
* @group ${group}-test
Expand Down
17 changes: 0 additions & 17 deletions data/crawler/skeleton/PluginTestSkeleton.php
Original file line number Diff line number Diff line change
@@ -1,24 +1,20 @@
<?php


use Midnight\Crawler\Plugin\${name},
Midnight\Crawler\Plugin\TestData\${name}TestData;

class ${name}Test extends PHPUnit_Framework_TestCase
{

/**
* @var ${name}
**/
private $plugin;


/**
* @var ${name}TestData
**/
private $test_data;


/**
* セットアップ
*
Expand All @@ -32,7 +28,6 @@ public function setUp ()
$this->plugin->setTestData($this->test_data);
}


/**
* @test
* @expectedException CrawlerException
Expand All @@ -55,7 +50,6 @@ public function RSSが取得出来なかった場合 ()
$this->plugin->fetchRss();
}


/**
* @test
* @group ${group}
Expand All @@ -67,7 +61,6 @@ public function RSSを取得する ()
$this->assertInstanceOf('DOMDocument', $dom);
}


/**
* @test
* @group ${group}
Expand All @@ -81,7 +74,6 @@ public function コンテンツ要素を取得する ()
$this->assertFalse(is_null($entries->item(0)));
}


/**
* @test
* @group ${group}
Expand All @@ -96,7 +88,6 @@ public function エントリのURLを取得する ()
$this->assertEquals('', $url);
}


/**
* @test
* @group ${group}-get-entry-date
Expand All @@ -111,7 +102,6 @@ public function エントリの日付を取得する ()
$this->assertEquals('', $date);
}


/**
* @test
* @medium
Expand All @@ -124,7 +114,6 @@ public function HTMLを取得する ()
$this->assertInstanceOf('simple_html_dom', $html);
}


/**
* @test
* @medium
Expand All @@ -139,7 +128,6 @@ public function エントリのタイトルを取得する ()
$this->assertEquals('', $title);
}


/**
* @test
* @medium
Expand All @@ -156,7 +144,6 @@ public function エントリのタイトルを取得出来なかった場合 ()
$this->plugin->getEntryTitle($html);
}


/**
* @test
* @medium
Expand All @@ -171,7 +158,6 @@ public function アイキャッチ画像のURLを取得する ()
$this->assertEquals('', $img_url);
}


/**
* @test
* @medium
Expand All @@ -188,7 +174,6 @@ public function アイキャッチの画像要素が見つからなかった場
$this->plugin->getEyeCatchUrl($html);
}


/**
* @test
* @medium
Expand All @@ -205,7 +190,6 @@ public function src属性が見つからなかった場合 ()
$this->plugin->getEyeCatchUrl($html);
}


/**
* @test
* @medium
Expand All @@ -221,4 +205,3 @@ public function 動画へのリンクを取得する1 ()
$this->assertEquals('', $movies_url[0]);
}
}

1 change: 0 additions & 1 deletion src/Bootstrap.php
Original file line number Diff line number Diff line change
Expand Up @@ -10,4 +10,3 @@

$loader = require_once ROOT.'/vendor/autoload.php';
$loader->set('Midnight', LIB);

7 changes: 0 additions & 7 deletions src/Midnight/Aws/AbstractAws.php
Original file line number Diff line number Diff line change
Expand Up @@ -6,31 +6,27 @@

abstract class AbstractAws
{

/**
* クライアントクラス
*
* @var mixed
**/
protected $client;


/**
* aws.iniへのパス
*
* @var string
**/
protected $aws_ini_path = 'data/config/aws.ini';


/**
* aws.iniのパースデータ
*
* @var array
**/
protected $ini;


/**
* コンストラクタ
*
Expand All @@ -41,7 +37,6 @@ public function __construct ()
$this->_initIniFile();
}


/**
* iniファイルを解析してメンバ変数に保存する
*
Expand All @@ -52,7 +47,6 @@ private function _initIniFile ()
$this->ini = parse_ini_file($this->aws_ini_path);
}


/**
* クライアントクラス生成に必要なコンフィグ値を配列で返す
*
Expand All @@ -68,4 +62,3 @@ public function getConfig ($region = Region::AP_NORTHEAST_1)
);
}
}

Loading

0 comments on commit b2fd712

Please sign in to comment.