Skip to content
This repository has been archived by the owner on Nov 28, 2019. It is now read-only.

Commit

Permalink
#22 implement origin_attachment_url
Browse files Browse the repository at this point in the history
  • Loading branch information
derpixler committed Jan 18, 2016
1 parent 7cf9fa5 commit 8127272
Show file tree
Hide file tree
Showing 3 changed files with 25 additions and 2 deletions.
6 changes: 6 additions & 0 deletions inc/Import/Type/ImportPostInterface.php
Original file line number Diff line number Diff line change
Expand Up @@ -98,4 +98,10 @@ public function meta();
* @return array
*/
public function locale_relations();


/**
* @return string
*/
public function origin_attachment_url();
}
17 changes: 16 additions & 1 deletion inc/Import/Type/WpImportPost.php
Original file line number Diff line number Diff line change
Expand Up @@ -108,6 +108,11 @@ class WpImportPost implements ImportPostInterface {
*/
private $locale_relations = array();

/**
* @var string
*/
private $origin_attachment_url = '';

/**
* @var Common\ParameterSanitizerInterface
*/
Expand Down Expand Up @@ -173,7 +178,8 @@ private function set_attributes( Array $attributes ) {
'password' => 'string',
'terms' => 'array',
'meta' => 'array',
'locale_relations' => 'array'
'locale_relations' => 'array',
'origin_attachment_url' => 'string'
);

$valid_attributes = $this->param_sanitizer
Expand Down Expand Up @@ -403,4 +409,13 @@ public function locale_relations() {

return $this->locale_relations;
}


/**
* @return string
*/
public function origin_attachment_url() {

return $this->origin_attachment_url;
}
}
4 changes: 3 additions & 1 deletion tests/phpunit/Unit/Import/Service/WpPostParserTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -233,7 +233,7 @@ public function parse_post_test_data() {
'date' => '2013-10-27 20:13:05',
'comment_status' => 'open',
'ping_status' => 'open',
'type' => 'post',
'type' => 'attachment',
'is_sticky' => 0,
'origin_link' => 'http://wpml.to.mlp/hello-world/',
'excerpt' => '',
Expand Down Expand Up @@ -313,6 +313,8 @@ public function parse_post_test_data() {
)
);

print_r( $data );

return $data;
}

Expand Down

0 comments on commit 8127272

Please sign in to comment.