8000 [Translation] Process multiple segments within a single unit. by timewasted · Pull Request #26247 · symfony/symfony · GitHub
[go: up one dir, main page]

Skip to content

[Translation] Process multiple segments within a single unit. #26247

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
wants to merge 3 commits into from
Closed
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Prefer assertSame() over assertEquals()
When performing tests, prefer using assertSame() over assertEquals()
where possible.
  • Loading branch information
timewasted committed Feb 20, 2018
commit 51aa2f0a629d4a4910eb4d9992d9428d2f8dfa64
Original file line number Diff line number Diff line change
Expand Up @@ -235,7 +235,7 @@ public function testLoadVersion2WithMultiSegmentUnit()
$resource = __DIR__.'/../fixtures/resources-2.0-multi-segment-unit.xlf';
$catalog = $loader->load($resource, 'en', 'domain1');

$this->assertEquals('en', $catalog->getLocale());
$this->assertSame('en', $catalog->getLocale());
$this->assertEquals(array(new FileResource($resource)), $catalog->getResources());
$this->assertSame(array(), libxml_get_errors());
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

IMO, $this->assertFalse(libxml_get_last_error()); would be better.


Expand All @@ -245,16 +245,16 @@ public function testLoadVersion2WithMultiSegmentUnit()
$this->assertNotEmpty($metadata);
$this->assertCount(1, $metadata['notes']);

$this->assertEquals('processed', $metadata['notes'][0]['category']);
$this->assertEquals('true', $metadata['notes'][0]['content']);
$this->assertSame('processed', $metadata['notes'][0]['category']);
$this->assertSame('true', $metadata['notes'][0]['content']);

// test for "bar" metadata
$this->assertTrue($catalog->defines('bar', 'domain1'));
$metadata = $catalog->getMetadata('bar', 'domain1');
$this->assertNotEmpty($metadata);
$this->assertCount(1, $metadata['notes']);

$this->assertEquals('processed', $metadata['notes'][0]['category']);
$this->assertEquals('true', $metadata['notes'][0]['content']);
$this->assertSame('processed', $metadata['notes'][0]['category']);
$this->assertSame('true', $metadata['notes'][0]['content']);
}
}
0