File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -35,6 +35,30 @@ public function testCollapsedSyntax(): void
3535 $ this ->assertEquals ($ translations ->find ('ctx ' , 'original ' )->getComments ()->toArray ()[0 ], ' comment ' );
3636 }
3737
38+ public function testPreviousTranslation (): void
39+ {
40+ $ po = '#| msgctxt "previous ctx"
41+ #| msgid "previous original"
42+ #| msgid_plural "previous plural"
43+ msgctxt "ctx"
44+ msgid "original"
45+ msgid_plural "plural"
46+ msgstr "translation" ' ;
47+ $ translations = $ this ->createPoLoader ()->loadString ($ po );
48+
49+ $ translation = $ translations ->find ('ctx ' , 'original ' );
50+ $ this ->assertNotNull ($ translation );
51+ $ this ->assertEquals ($ translation ->getContext (), 'ctx ' );
52+ $ this ->assertEquals ($ translation ->getOriginal (), 'original ' );
53+ $ this ->assertEquals ($ translation ->getPlural (), 'plural ' );
54+ $ this ->assertEquals ($ translation ->getTranslation (), 'translation ' );
55+
56+ $ this ->assertEquals ($ translation ->getPreviousContext (), 'previous ctx ' );
57+ $ this ->assertEquals ($ translation ->getPreviousOriginal (), 'previous original ' );
58+ $ this ->assertEquals ($ translation ->getPreviousPlural (), 'previous plural ' );
59+
60+ }
61+
3862 public function badFormattedPoProvider (): array
3963 {
4064 return [
You can’t perform that action at this time.
0 commit comments