forked from php-tmdb/api
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
ff72b62
commit 5b21bf5
Showing
3 changed files
with
317 additions
and
54 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,57 @@ | ||
<?php | ||
/** | ||
* This file is part of the Tmdb PHP API created by Michael Roterman. | ||
* | ||
* For the full copyright and license information, please view the LICENSE | ||
* file that was distributed with this source code. | ||
* | ||
* @package Tmdb | ||
* @author Michael Roterman <[email protected]> | ||
* @copyright (c) 2013, Michael Roterman | ||
* @version 0.0.1 | ||
*/ | ||
namespace Tmdb\Tests\Factory; | ||
|
||
use Tmdb\Factory\CertificationFactory; | ||
use Tmdb\Model\Certification; | ||
|
||
class CertificationFactoryTest extends TestCase | ||
{ | ||
private $data; | ||
|
||
public function setUp() | ||
{ | ||
$this->data = $this->loadByFile('certification/get.json'); | ||
} | ||
|
||
/** | ||
* @test | ||
*/ | ||
public function shouldConstructCertification() | ||
{ | ||
/** | ||
* @var CertificationFactory $factory | ||
*/ | ||
$factory = $this->getFactory(); | ||
$certificationCollection = $factory->createCollection($this->data); | ||
|
||
$this->assertInstanceOf('Tmdb\Model\Common\GenericCollection', $certificationCollection); | ||
|
||
/** | ||
* @var Certification $certificationCountry | ||
*/ | ||
foreach($certificationCollection as $certificationCountry) { | ||
$this->assertInstanceOf('Tmdb\Model\Certification', $certificationCountry); | ||
$this->assertNotEmpty($certificationCountry->getCountry()); | ||
|
||
foreach($certificationCountry->getCertifications() as $certification) { | ||
$this->assertInstanceOf('Tmdb\Model\Certification\CountryCertification', $certification); | ||
} | ||
} | ||
} | ||
|
||
protected function getFactoryClass() | ||
{ | ||
return 'Tmdb\Factory\CertificationFactory'; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,260 @@ | ||
{ | ||
"certifications": { | ||
"AU": [ | ||
{ | ||
"certification": "E", | ||
"meaning": "Exempt from classification. Films that are exempt from classification must not contain contentious material (i.e. material that would ordinarily be rated M or higher).", | ||
"order": 1 | ||
}, | ||
{ | ||
"certification": "G", | ||
"meaning": "General. The content is very mild in impact.", | ||
"order": 2 | ||
}, | ||
{ | ||
"certification": "PG", | ||
"meaning": "Parental guidance recommended. There are no age restrictions. The content is mild in impact.", | ||
"order": 2 | ||
}, | ||
{ | ||
"certification": "M", | ||
"meaning": "Recommended for mature audiences. There are no age restrictions. The content is moderate in impact.", | ||
"order": 3 | ||
}, | ||
{ | ||
"certification": "MA15+", | ||
"meaning": "Mature Accompanied. Unsuitable for children younger than 15. Children younger than 15 years must be accompanied by a parent or guardian. The content is strong in impact.", | ||
"order": 5 | ||
}, | ||
{ | ||
"certification": "R18+", | ||
"meaning": "Restricted to 18 years and over. Adults only. The content is high in impact.", | ||
"order": 6 | ||
}, | ||
{ | ||
"certification": "X18+", | ||
"meaning": "Restricted to 18 years and over. Films with this rating have pornographic content. Films classified as X18+ are banned from being sold or rented in all Australian states and are only legally available in the Australian Capital Territory and the Northern Territory. However, importing X18+ material from the two territories to any of the Australian states is legal.The content is sexually explicit in impact.", | ||
"order": 7 | ||
}, | ||
{ | ||
"certification": "RC", | ||
"meaning": "Refused Classification. Banned from sale or hire in Australia; also generally applies to importation (if inspected by and suspicious to Customs). Private Internet viewing is unenforced and attempts to legally censor such online material has resulted in controversy. Films are rated RC if their content exceeds the guidelines. The content is very high in impact.", | ||
"order": 8 | ||
} | ||
], | ||
"CA": [ | ||
{ | ||
"certification": "G", | ||
"meaning": "All ages.", | ||
"order": 1 | ||
}, | ||
{ | ||
"certification": "PG", | ||
"meaning": "Parental guidance advised. There is no age restriction but some material may not be suitable for all children.", | ||
"order": 2 | ||
}, | ||
{ | ||
"certification": "14A", | ||
"meaning": "Persons under 14 years of age must be accompanied by an adult.", | ||
"order": 3 | ||
}, | ||
{ | ||
"certification": "18A", | ||
"meaning": "Persons under 18 years of age must be accompanied by an adult. In the Maritimes & Manitoba, children under the age of 14 are prohibited from viewing the film.", | ||
"order": 4 | ||
}, | ||
{ | ||
"certification": "R", | ||
"meaning": "Admittance restricted to people 18 years of age or older.", | ||
"order": 5 | ||
}, | ||
{ | ||
"certification": "A", | ||
"meaning": "Admittance restricted to people 18 years of age or older. Sole purpose of the film is the portrayal of sexually explicit activity and/or explicit violence.", | ||
"order": 5 | ||
} | ||
], | ||
"DE": [ | ||
{ | ||
"certification": "0", | ||
"meaning": "No age restriction.", | ||
"order": 1 | ||
}, | ||
{ | ||
"certification": "6", | ||
"meaning": "No children younger than 6 years admitted.", | ||
"order": 2 | ||
}, | ||
{ | ||
"certification": "12", | ||
"meaning": "Children 12 or older admitted, children between 6 and 11 only when accompanied by parent or a legal guardian.", | ||
"order": 3 | ||
}, | ||
{ | ||
"certification": "16", | ||
"meaning": "Children 16 or older admitted, nobody under this age admitted.", | ||
"order": 4 | ||
}, | ||
{ | ||
"certification": "18", | ||
"meaning": "No youth admitted, only adults.", | ||
"order": 5 | ||
} | ||
], | ||
"FR": [ | ||
{ | ||
"certification": "U", | ||
"meaning": "(Tous publics) valid for all audiences.", | ||
"order": 1 | ||
}, | ||
{ | ||
"certification": "10", | ||
"meaning": "(Déconseillé aux moins de 10 ans) unsuitable for children younger than 10 (this rating is only used for TV); equivalent in theatres : \"avertissement\" (warning), some scenes may be disturbing to young children and sensitive people; equivalent on video : \"accord parental\" (parental guidance).", | ||
"order": 2 | ||
}, | ||
{ | ||
"certification": "12", | ||
"meaning": "(Interdit aux moins de 12 ans) unsuitable for children younger than 12 or forbidden in cinemas for under 12.", | ||
"order": 3 | ||
}, | ||
{ | ||
"certification": "16", | ||
"meaning": "(Interdit aux moins de 16 ans) unsuitable for children younger than 16 or forbidden in cinemas for under 16.", | ||
"order": 4 | ||
}, | ||
{ | ||
"certification": "18", | ||
"meaning": "(Interdit aux mineurs) unsuitable for children younger than 18 or forbidden in cinemas for under 18.", | ||
"order": 5 | ||
} | ||
], | ||
"GB": [ | ||
{ | ||
"certification": "U", | ||
"meaning": "All ages admitted, there is nothing unsuitable for children.", | ||
"order": 1 | ||
}, | ||
{ | ||
"certification": "PG", | ||
"meaning": "All ages admitted, but certain scenes may be unsuitable for young children. May contain mild language and sex/drugs references. May contain moderate violence if justified by context (e.g. fantasy).", | ||
"order": 2 | ||
}, | ||
{ | ||
"certification": "12A", | ||
"meaning": "Films under this category are considered to be unsuitable for very young people. Those aged under 12 years are only admitted if accompanied by an adult, aged at least 18 years, at all times during the motion picture. However, it is generally not recommended that children under 12 years should watch the film. Films under this category can contain mature themes, discrimination, soft drugs, moderate swear words, infrequent strong language and moderate violence, sex references and nudity. Sexual activity may be briefly and discreetly portrayed. Sexual violence may be implied or briefly indicated.", | ||
"order": 3 | ||
}, | ||
{ | ||
"certification": "12", | ||
"meaning": "Home media only since 2002. 12A-rated films are usually given a 12 certificate for the VHS/DVD version unless extra material has been added that requires a higher rating. Nobody younger than 12 can rent or buy a 12-rated VHS, DVD, Blu-ray Disc, UMD or game. The content guidelines are identical to those used for the 12A certificate.", | ||
"order": 4 | ||
}, | ||
{ | ||
"certification": "15", | ||
"meaning": "Only those over 15 years are admitted. Nobody younger than 15 can rent or buy a 15-rated VHS, DVD, Blu-ray Disc, UMD or game, or watch a film in the cinema with this rating. Films under this category can contain adult themes, hard drugs, frequent strong language and limited use of very strong language, strong violence and strong sex references, and nudity without graphic detail. Sexual activity may be portrayed but without any strong detail. Sexual violence may be shown if discreet and justified by context.", | ||
"order": 5 | ||
}, | ||
{ | ||
"certification": "18", | ||
"meaning": "Only adults are admitted. Nobody younger than 18 can rent or buy an 18-rated VHS, DVD, Blu-ray Disc, UMD or game, or watch a film in the cinema with this rating. Films under this category do not have limitation on the bad language that is used. Hard drugs are generally allowed, and explicit sex references along with detailed sexual activity are also allowed. Scenes of strong real sex may be permitted if justified by the context. Very strong, gory, and/or sadistic violence is usually permitted. Strong sexual violence is permitted unless it is eroticised or excessively graphic.", | ||
"order": 6 | ||
}, | ||
{ | ||
"certification": "R18", | ||
"meaning": "Can only be shown at licensed adult cinemas or sold at licensed sex shops, and only to adults, those aged 18 or over. Films under this category are always hard-core pornography, defined as material intended for sexual stimulation and containing clear images of real sexual activity, strong fetish material, explicit animated images, or sight of certain acts such as triple simultaneous penetration and snowballing. There remains a range of material that is often cut from the R18 rating: strong images of injury in BDSM or spanking works, urolagnia, scenes suggesting incest even if staged, references to underage sex or childhood sexual development and aggressive behaviour such as hair-pulling or spitting on a performer are not permitted. More cuts are demanded in this category than any other category.", | ||
"order": 7 | ||
} | ||
], | ||
"IN": [ | ||
{ | ||
"certification": "U", | ||
"meaning": "Unrestricted Public Exhibition throughout India, suitable for all age groups. Films under this category should not upset children over 4. Such films may contain educational, social or family-oriented themes. Films under this category may also contain fantasy violence and/or mild bad language.", | ||
"order": 0 | ||
}, | ||
{ | ||
"certification": "UA", | ||
"meaning": "All ages admitted, but it is advised that children below 12 be accompanied by a parent as the theme or content may be considered intense or inappropriate for young children. Films under this category may contain mature themes, sexual references, mild sex scenes, violence with brief gory images and/or infrequent use of crude language.", | ||
"order": 1 | ||
}, | ||
{ | ||
"certification": "A", | ||
"meaning": "Restricted to adult audiences (18 years or over). Nobody below the age of 18 may buy/rent an A-rated DVD, VHS, UMD or watch a film in the cinema with this rating. Films under this category may contain adult/disturbing themes, frequent crude language, brutal violence with blood and gore, strong sex scenes and/or scenes of drug abuse which is considered unsuitable for minors.", | ||
"order": 2 | ||
} | ||
], | ||
"NZ": [ | ||
{ | ||
"certification": "G", | ||
"meaning": "Suitable for general audiences.", | ||
"order": 1 | ||
}, | ||
{ | ||
"certification": "PG", | ||
"meaning": "Parental guidance recommended for younger viewers.", | ||
"order": 2 | ||
}, | ||
{ | ||
"certification": "M", | ||
"meaning": "Suitable for (but not restricted to) mature audiences 16 years and up.", | ||
"order": 3 | ||
}, | ||
{ | ||
"certification": "13", | ||
"meaning": "Restricted to persons 13 years of age and over.", | ||
"order": 4 | ||
}, | ||
{ | ||
"certification": "15", | ||
"meaning": "Restricted to persons 15 years of age and over.", | ||
"order": 5 | ||
}, | ||
{ | ||
"certification": "16", | ||
"meaning": "Restricted to persons 16 years of age and over.", | ||
"order": 6 | ||
}, | ||
{ | ||
"certification": "18", | ||
"meaning": "Restricted to persons 18 years of age and over.", | ||
"order": 7 | ||
}, | ||
{ | ||
"certification": "R", | ||
"meaning": "Restricted to a particular class of persons, or for particular purposes, or both.", | ||
"order": 8 | ||
} | ||
], | ||
"US": [ | ||
{ | ||
"certification": "NR", | ||
"meaning": "No rating information.", | ||
"order": 0 | ||
}, | ||
{ | ||
"certification": "G", | ||
"meaning": "All ages admitted. There is no content that would be objectionable to most parents. This is one of only two ratings dating back to 1968 that still exists today.", | ||
"order": 1 | ||
}, | ||
{ | ||
"certification": "PG", | ||
"meaning": "Some material may not be suitable for children under 10. These films may contain some mild language, crude/suggestive humor, scary moments and/or violence. No drug content is present. There are a few exceptions to this rule. A few racial insults may also be heard.", | ||
"order": 2 | ||
}, | ||
{ | ||
"certification": "PG-13", | ||
"meaning": "Some material may be inappropriate for children under 13. Films given this rating may contain sexual content, brief or partial nudity, some strong language and innuendo, humor, mature themes, political themes, terror and/or intense action violence. However, bloodshed is rarely present. This is the minimum rating at which drug content is present.", | ||
"order": 3 | ||
}, | ||
{ | ||
"certification": "R", | ||
"meaning": "Under 17 requires accompanying parent or adult guardian 21 or older. The parent/guardian is required to stay with the child under 17 through the entire movie, even if the parent gives the child/teenager permission to see the film alone. These films may contain strong profanity, graphic sexuality, nudity, strong violence, horror, gore, and strong drug use. A movie rated R for profanity often has more severe or frequent language than the PG-13 rating would permit. An R-rated movie may have more blood, gore, drug use, nudity, or graphic sexuality than a PG-13 movie would admit.", | ||
"order": 4 | ||
}, | ||
{ | ||
"certification": "NC-17", | ||
"meaning": "These films contain excessive graphic violence, intense or explicit sex, depraved, abhorrent behavior, explicit drug abuse, strong language, explicit nudity, or any other elements which, at present, most parents would consider too strong and therefore off-limits for viewing by their children and teens. NC-17 does not necessarily mean obscene or pornographic in the oft-accepted or legal meaning of those words.", | ||
"order": 5 | ||
} | ||
] | ||
} | ||
} |