Jump to content

Template:Legifrance/testcases

From Wikipedia, the free encyclopedia

Basic tests

[edit]
Test 1a base, number, and text
{{Legifrance|base=JORF |number=JUSX9800048L |text=Law 2000-516 of 15 June 2000}}

{{Legifrance}}

Law 2000-516 of 15 June 2000

{{Legifrance/sandbox}}

Law 2000-516 of 15 June 2000

Test 1b - same, with param aliases 'numéro' and 'texte'
{{Legifrance|base=JORF |numéro=INPA2020854X |texte=Composition de l'assemblée, 4 August 2020}}

{{Legifrance}}

Composition de l'assemblée, 4 August 2020

{{Legifrance/sandbox}}

Composition de l'assemblée, 4 August 2020

Test 1c-1 - base=CPP
Test 1c-2 - base=CPP (French)
Test 1d-1 - base=CP
{{Legifrance|base=CP |number=111-2}}

{{Legifrance}}

Penal code, 111-2

{{Legifrance/sandbox}}

Penal code, 111-2

Test 1d-2 - base=CP (French)
{{Legifrance|base=CP |lang=fr |number=111-2}}

{{Legifrance}}

Code pénal, 111-2

{{Legifrance/sandbox}}

Code pénal, 111-2

Test 1e-1 - base=NCPC
Test 1e-2 - base=NCPC (French)
{{Legifrance|base=NCPC |lang=fr |number=32-1}}

{{Legifrance}}

Code de procédure civile, 32-1

{{Legifrance/sandbox}}

Code de procédure civile, 32-1

Test 1f-1 - base=CCOM
{{Legifrance|base=CCOM |number=420-2}}

{{Legifrance}}

Commercial code, 420-2

{{Legifrance/sandbox}}

Commercial code, 420-2

Test 1f-2 - base=CCOM (French)
{{Legifrance|base=CCOM |lang=fr |number=420-2}}

{{Legifrance}}

Code de commerce, 420-2

{{Legifrance/sandbox}}

Code de commerce, 420-2

Test 1g-2 - base=CGCT (French)
Test 1h - url and text for section of laws "75 to 78"
{{Legifrance|text=75 to 78 |url=https://www.legifrance.gouv.fr/codes/section_lc/LEGITEXT000006071154/LEGISCTA000006151877/#LEGISCTA000006151877}}

{{Legifrance}}

75 to 78

{{Legifrance/sandbox}}

75 to 78

Test 1i-1 - base=ARTI - indefinite base=ARTI for use with items that have multiple articles, like the Constitution (always use param 'text')
{{Legifrance|base=ARTI |number=000019241062 |text=Constitution article 49}}

{{Legifrance}}

Constitution article 49

{{Legifrance/sandbox}}

Constitution article 49

Test 1i-2 - base=ARTI - as above, showing undesirable display value if you leave out param 'text'
{{Legifrance|base=ARTI |number=000019241062}}

{{Legifrance}}

indefinite base, 000019241062

{{Legifrance/sandbox}}

indefinite base, 000019241062

Aliases

[edit]
Test 2a: using standard args base, numéro, and texte
{{Legifrance|base=CPP |numéro=62-2 |texte=CPP Art. 62-2}}

{{Legifrance}}

CPP Art. 62-2

{{Legifrance/sandbox}}

CPP Art. 62-2

Test 2b: same as 2a, using aliases number, and text
{{Legifrance|base=CPP |number=62-2 |text=CPP Art. 62-2}}

{{Legifrance}}

CPP Art. 62-2

{{Legifrance/sandbox}}

CPP Art. 62-2

Error cases

[edit]
Test 3a: missing 'number' param
{{Legifrance|base=CPP |text=CPP Art. 62-2}}

{{Legifrance}}

Template:Legifrance: missing or invalid base value ('CPP'), or missing number

{{Legifrance/sandbox}}

Template:Legifrance: missing or invalid base value ('CPP'), or missing number

Test 3b: missing 'text' param
Test 3c: invalid 'base' value (causes Linter "wikilink in external link" error)
{{Legifrance|base=TWEEDLEDUM |number=62-2 |text=CPP Art. 62-2}}

{{Legifrance}}

Template:Legifrance: missing or invalid base value ('TWEEDLEDUM'), or missing number

{{Legifrance/sandbox}}

Template:Legifrance: missing or invalid base value ('TWEEDLEDUM'), or missing number

Test 3d: missing 'base' param
{{Legifrance|num=62-2 |text=CPP Art. 62-2}}

{{Legifrance}}

Template:Legifrance: missing or invalid base value (' '), or missing number

{{Legifrance/sandbox}}

Template:Legifrance: missing or invalid base value (' '), or missing number

Main db codes (CCOM, etc.)

[edit]
Test 4a: base values whose urls changed in 2020 modernization: CCOM L420-2
{{Legifrance|base=CCOM |number=L420-2}}

{{Legifrance}}

Commercial code, L420-2

{{Legifrance/sandbox}}

Commercial code, L420-2

Test 4b-1: base CCOM L120-12
{{Legifrance|base=CCOM |number=L120-12}}

{{Legifrance}}

Commercial code, L120-12

{{Legifrance/sandbox}}

Commercial code, L120-12

Test 4b-2: base CCOM L120-12, using French text for code
{{Legifrance|base=CCOM |lang=fr |number=L120-12}}

{{Legifrance}}

Code de commerce, L120-12

{{Legifrance/sandbox}}

Code de commerce, L120-12

Test 4c: base CCOM L242-31 (abrogated law)
{{Legifrance|base=CCOM |number=L242-31}}

{{Legifrance}}

Commercial code, L242-31

{{Legifrance/sandbox}}

Commercial code, L242-31

Test 4d: base CCOM A444-105
{{Legifrance|base=CCOM |number=A444-105}}

{{Legifrance}}

Commercial code, A444-105

{{Legifrance/sandbox}}

Commercial code, A444-105

Test 4e-1: base CCOM D122-1
{{Legifrance|base=CCOM |number=D122-1}}

{{Legifrance}}

Commercial code, D122-1

{{Legifrance/sandbox}}

Commercial code, D122-1

Test 4e-2: base CCOM L122-1
{{Legifrance|base=CCOM |number=L122-1}}

{{Legifrance}}

Commercial code, L122-1

{{Legifrance/sandbox}}

Commercial code, L122-1

Test 4e-3: base CCOM R122-1
{{Legifrance|base=CCOM |number=R122-1}}

{{Legifrance}}

Commercial code, R122-1

{{Legifrance/sandbox}}

Commercial code, R122-1

Test 4f: base CCOM R722-3
{{Legifrance|base=CCOM |number=R722-3}}

{{Legifrance}}

Commercial code, R722-3

{{Legifrance/sandbox}}

Commercial code, R722-3

Journal Officiel (JORF) by NOR and by numeric ID

[edit]
Test 5a: JORF with NOR code (mix of alphabetic and numeric characters)
Test 5c: JORFID with numeric id (typically start with a string of zeroes)
Test 5d: JORFID with numeric id
Test 5e: JORFID with numeric id, loadable text (ord. 58-1067 of 1958-7-11)
Test 5f: JORF/NOR with text param
{{Legifrance|base=JORF |number=JUSX9800048L |text=Law 2000-516 of 15 June 2000 (presumption of innocence)}}

{{Legifrance}}

Law 2000-516 of 15 June 2000 (presumption of innocence)

{{Legifrance/sandbox}}

Law 2000-516 of 15 June 2000 (presumption of innocence)

Test 5g: JORFID with text param
{{Legifrance|base=JORFID |number=000000671775 |text=Vichy consitutional law #2 of 11 July 1940}}

{{Legifrance}}

Vichy consitutional law #2 of 11 July 1940

{{Legifrance/sandbox}}

Vichy consitutional law #2 of 11 July 1940

Extra db codes (generally post-2008)

[edit]
Test 6a: Transport code (CTRANSP) L1000-2
{{Legifrance|base=CTRANSP |number=L1000-2}}

{{Legifrance}}

Transport code, L1000-2

{{Legifrance/sandbox}}

Transport code, L1000-2

Test 6b: Transport code L1121-1
{{Legifrance|base=CTRANSP |number=L1121-1}}

{{Legifrance}}

Transport code, L1121-1

{{Legifrance/sandbox}}

Transport code, L1121-1

Test 6c: Transport code D1112-1
{{Legifrance|base=CTRANSP |number=D1112-1}}

{{Legifrance}}

Transport code, D1112-1

{{Legifrance/sandbox}}

Transport code, D1112-1

Test 6d: Transport code R1112-11
{{Legifrance|base=CTRANSP |number=R1112-11}}

{{Legifrance}}

Transport code, R1112-11

{{Legifrance/sandbox}}

Transport code, R1112-11

Test 6e: Penitentiary code
{{Legifrance|base=CPEN |number=L3}}

{{Legifrance}}

Penitentiary code, L3

{{Legifrance/sandbox}}

Penitentiary code, L3

Test 6f-1: Penitentiary code L112-1
{{Legifrance|base=CPEN |number=L112-1}}

{{Legifrance}}

Penitentiary code, L112-1

{{Legifrance/sandbox}}

Penitentiary code, L112-1

Test 6f-2: Penitentiary code L112-1 (French)
{{Legifrance|base=CPEN |lang=fr |number=L112-1}}

{{Legifrance}}

Code pénitentiaire, L112-1

{{Legifrance/sandbox}}

Code pénitentiaire, L112-1

Test 6g: Penitentiary code D112-1
{{Legifrance|base=CPEN |number=D112-1}}

{{Legifrance}}

Penitentiary code, D112-1

{{Legifrance/sandbox}}

Penitentiary code, D112-1

Test 6h: Penitentiary code R112-2
{{Legifrance|base=CPEN |number=R112-2}}

{{Legifrance}}

Penitentiary code, R112-2

{{Legifrance/sandbox}}

Penitentiary code, R112-2

Test 6i-1: Penitentiary code D112-21-1
{{Legifrance|base=CPEN |number=D112-21-1}}

{{Legifrance}}

Penitentiary code, D112-21-1

{{Legifrance/sandbox}}

Penitentiary code, D112-21-1

Test 6i-2: Penitentiary code D112-21-1 (French)
{{Legifrance|base=CPEN |lang=fr |number=D112-21-1}}

{{Legifrance}}

Code pénitentiaire, D112-21-1

{{Legifrance/sandbox}}

Code pénitentiaire, D112-21-1

L prefix defaulting for certain base codes

[edit]

Test adding 'L' prefix for certain codes for which articles always start with a letter, and never a numeric.

Article numbers often have a prefix letter, such as 'L' (for loi), 'D' (décret), 'R' (regulation), and sometimes 'A' (arrêt). For certain codes, such as the Civil Code, the Penal Code, or the Code of Criminal Procedure, there is no prefix, and the article number is strictly numeric. For those codes that use the L/D/R prefix such as the Labor code, the Education Code, and the Administrative Code, the most common of the three is 'L', and as a convenience to the template user, if they forget to include the prefix and pass a numeric argument to a code that requires it, the 'L' prefix is added. This is currently implemented for base codes CT (Code du travail), CPEN (Code pénitentiaire), and CTRANSP (Code des transports).

Test 7a-1: Transport code (CTRANSP) L1000-2
{{Legifrance|base=CTRANSP |number=L1000-2}}

{{Legifrance}}

Transport code, L1000-2

{{Legifrance/sandbox}}

Transport code, L1000-2

Test 7a-2: CTRANSP 1000-2 (missing prefix ⟶ 'L1000-2')
{{Legifrance|base=CTRANSP |number=1000-2}}

{{Legifrance}}

Transport code, 1000-2

{{Legifrance/sandbox}}

Transport code, 1000-2

Test 7b-1: CTRANSP D1112-1
{{Legifrance|base=CTRANSP |number=D1112-1}}

{{Legifrance}}

Transport code, D1112-1

{{Legifrance/sandbox}}

Transport code, D1112-1

Test 7b-2: CTRANSP 1112-1 (missing prefix ⟶ 'L1112-1', not 'D')
{{Legifrance|base=CTRANSP |number=1112-1}}

{{Legifrance}}

Transport code, 1112-1

{{Legifrance/sandbox}}

Transport code, 1112-1

Test 7c-1: CTRANSP R1112-11
{{Legifrance|base=CTRANSP |number=R1112-11}}

{{Legifrance}}

Transport code, R1112-11

{{Legifrance/sandbox}}

Transport code, R1112-11

Test 7c-2: CTRANSP 1112-11 (missing prefix ⟶ 'L1112-11', not 'R')
{{Legifrance|base=CTRANSP |number=1112-11}}

{{Legifrance}}

Transport code, 1112-11

{{Legifrance/sandbox}}

Transport code, 1112-11